lib/temporize/scheduler.rb
#Queue a job to refresh the token at the specified time and date
Queue a job to refresh the token at the specified time and date
Queue a job to refresh the token at the specified time and date
def queue_refresh(time, signature)
      hook_url = CGI::escape("#{config.app_url}/hooks/refresh/#{signature}")
      schedule = CGI::escape(if config.token_refresh_mode == :scheduled
        time.utc.iso8601
      else
        case config.token_refresh_frequency
        when :daily
          '0 0 * * ?'   
        when :monthly
          '0 0 1 * ?'   
        else
          '0 0 * * ?'   
        end
      end)
      Temporize::Scheduler.post("/events/#{schedule}/#{hook_url}", basic_auth: credentials).success?
    end
def queue_refresh ( time , signature ) hook_url = CGI :: escape ( "#{config.app_url}/hooks/refresh/#{signature}" ) schedule = CGI :: escape ( if config . token_refresh_mode == :scheduled time . utc . iso8601 else case config . token_refresh_frequency when :daily '0 0 * * ?' when :monthly '0 0 1 * ?' else '0 0 * * ?' end end ) Temporize :: Scheduler . post ( "/events/#{schedule}/#{hook_url}" , basic_auth : credentials ) . success? end
Queue a job to refresh the token at the specified time and date
Queue a job to refresh the token at the specified time and date
# Midnight every day # First day of each month # Every Sunday
time
signature