Use Sinatra config in whenever
This commit is contained in:
parent
495d29a0ae
commit
54d721abd4
4 changed files with 11 additions and 9 deletions
1
Gemfile
1
Gemfile
|
|
@ -12,3 +12,4 @@ gem 'bcrypt'
|
|||
gem 'gettext'
|
||||
gem 'mail'
|
||||
gem 'redcarpet'
|
||||
gem 'whenever'
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ GEM
|
|||
bcrypt (3.1.20)
|
||||
benchmark (0.4.0)
|
||||
bigdecimal (3.1.9)
|
||||
chronic (0.10.2)
|
||||
concurrent-ruby (1.3.5)
|
||||
connection_pool (2.5.0)
|
||||
date (3.4.1)
|
||||
|
|
@ -92,11 +93,16 @@ GEM
|
|||
singleton (0.3.0)
|
||||
sqlite3 (2.6.0)
|
||||
mini_portile2 (~> 2.8.0)
|
||||
sqlite3 (2.6.0-arm64-darwin)
|
||||
sqlite3 (2.6.0-x86_64-darwin)
|
||||
sqlite3 (2.6.0-x86_64-linux-gnu)
|
||||
text (1.3.1)
|
||||
tilt (2.6.0)
|
||||
timeout (0.4.3)
|
||||
tzinfo (2.0.6)
|
||||
concurrent-ruby (~> 1.0)
|
||||
whenever (1.1.2)
|
||||
chronic (>= 0.6.3)
|
||||
|
||||
PLATFORMS
|
||||
arm64-darwin
|
||||
|
|
@ -117,6 +123,7 @@ DEPENDENCIES
|
|||
sinatra
|
||||
sinatra-activerecord
|
||||
sqlite3
|
||||
whenever
|
||||
|
||||
BUNDLED WITH
|
||||
2.3.15
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
if ENV['RACK_ENV']
|
||||
set :environment, ENV['RACK_ENV']
|
||||
end
|
||||
require_relative '../vedia'
|
||||
|
||||
set :environment_variable, 'RACK_ENV'
|
||||
|
||||
every 5.minutes do
|
||||
rake "close_expired_votes"
|
||||
|
|
|
|||
6
vedia.rb
6
vedia.rb
|
|
@ -1,10 +1,4 @@
|
|||
require 'sinatra'
|
||||
|
||||
# Set environment before requiring 'sinatra/activerecord' to make `whenever` uses the database.
|
||||
if ENV['RAILS_ENV']
|
||||
set :environment, ENV['RAILS_ENV']
|
||||
end
|
||||
|
||||
require 'sinatra/activerecord'
|
||||
require 'bcrypt'
|
||||
require 'gettext'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue