Skip to content

Instantly share code, notes, and snippets.

@Samda
Created December 25, 2020 10:26
Show Gist options
  • Save Samda/ebd19aeede1883ac7494b5b551a51a3c to your computer and use it in GitHub Desktop.
Save Samda/ebd19aeede1883ac7494b5b551a51a3c to your computer and use it in GitHub Desktop.

Revisions

  1. Samda created this gist Dec 25, 2020.
    10 changes: 10 additions & 0 deletions schedule.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    set :output, "#{path}/log/cron.log"
    set :env_path, '"$HOME/.rbenv/shims":"$HOME/.rbenv/bin"'

    job_type :rails, %q{ cd :path && PATH=:env_path:"$PATH" RAILS_ENV=:environment bundle exec rails :task --silent :output }
    job_type :runner, %q{ cd :path && PATH=:env_path:"$PATH" bin/rails runner -e :environment ':task' :output }
    job_type :script, %q{ cd :path && PATH=:env_path:"$PATH" RAILS_ENV=:environment bundle exec bin/:task :output }

    every 1.minute do
    rails 'message:send_to_clients'
    end