-
-
Save Evshved/d209b46cfee05f8b01ece098d1045971 to your computer and use it in GitHub Desktop.
sidekiq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
whenever --update-crontab |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MonitoringController < ApplicationController | |
MAX_QUEUE_SIZE = 10_000.freeze | |
def queue | |
size = Sidekiq::Stats.new.queues.values.reduce(:+) | |
status = size < MAX_QUEUE_SIZE ? 'GOOD' : 'BAD' | |
render json: status, status: :ok | |
end | |
def scheduler | |
count = ScheduledFacebookWallPost.successful | |
.where('publish_at >= ?', 3.hour.ago) | |
.count | |
status = count.positive? ? ‘GOOD’ : ‘BAD’ | |
render json: status, status: :ok | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment