class SidekiqScheduler::Manager

def find_next_timestamp

def find_next_timestamp
  timestamp = redis.zrangebyscore('delayed_queue_schedule', '-inf', Time.now.to_i, :limit => [0, 1])
  if timestamp.is_a?(Array)
    timestamp = timestamp.first
  end
  timestamp.to_i unless timestamp.nil?
end