File tree Expand file tree Collapse file tree 4 files changed +7
-29
lines changed Expand file tree Collapse file tree 4 files changed +7
-29
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2
2
3
3
class RemoveOldLtiLaunchJob < ApplicationJob
4
4
def perform
5
- Resque . logger . info ( 'Removing old LtiLaunch ' )
5
+ Resque . logger . info ( 'Removing old LtiLaunches ' )
6
6
query_started = Time . now . utc
7
7
date_limit = Rails . configuration . lti_launch_days_to_delete . days . ago . utc
8
- deleted_lti_launches = RailsLti2Provider ::LtiLaunch . where ( 'created_at > ?' , date_limit ) . delete_all
8
+ deleted_lti_launches = RailsLti2Provider ::LtiLaunch . where ( 'created_at < ?' , date_limit ) . delete_all
9
9
query_duration = Time . now . utc - query_started
10
- Resque . logger . info ( "Removed the LtiLaunch from before #{ date_limit } , " \
11
- "#{ deleted_lti_launches } LtiLaunch deleted, " \
10
+ Resque . logger . info ( "Removed the LtiLaunches from before #{ date_limit } , " \
11
+ "#{ deleted_lti_launches } launches deleted, " \
12
12
"in: #{ query_duration . round ( 3 ) } seconds" )
13
13
end
14
14
end
Original file line number Diff line number Diff line change @@ -55,10 +55,9 @@ class Application < Rails::Application
55
55
56
56
config . launch_nonce_duration = ( ENV [ 'LAUNCH_NONCE_DURATION' ] || 300 ) . to_i . seconds
57
57
58
- # Configures how many days AppLaunches will be kept on the db.
59
- # AppLaunches that are more than {app_launch_days_to_delete} days old will be deleted
60
- # every time app_launch is called.
61
- config . app_launch_days_to_delete = ( ENV [ 'APP_LAUNCH_DAYS_TO_DELETE' ] || 15 ) . to_i
58
+ # Configures how many days LtiLaunches will be kept on the db.
59
+ # LtiLaunches that are more than {lti_launch_days_to_delete} days old will be deleted
60
+ # every time the RemoveOldLtiLaunchJob runs.
62
61
config . lti_launch_days_to_delete = ( ENV [ 'LTI_LAUNCH_DAYS_TO_DELETE' ] || 1 ) . to_i
63
62
64
63
config . app_name = ENV [ 'APP_NAME' ] || 'BbbLtiBroker'
Original file line number Diff line number Diff line change 1
- remove_old_app_launch_job :
2
- # Every day at 01 GMT -3
3
- cron : " 0 4 * * *"
4
- class : RemoveOldAppLaunchJob
5
- queue : default
6
- description : " Remove old AppLaunches"
7
-
8
1
remove_old_lti_launch_job :
9
2
# Every day at 01 GMT -3
10
3
cron : " 0 4 * * *"
You can’t perform that action at this time.
0 commit comments