Skip to content

Commit 5f15301

Browse files
committed
feat: remove remove_old_app_launch_job
Not used anymore
1 parent 87f8a99 commit 5f15301

File tree

4 files changed

+7
-29
lines changed

4 files changed

+7
-29
lines changed

app/jobs/remove_old_app_launch_job.rb

Lines changed: 0 additions & 14 deletions
This file was deleted.

app/jobs/remove_old_lti_launch_job.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
class RemoveOldLtiLaunchJob < ApplicationJob
44
def perform
5-
Resque.logger.info('Removing old LtiLaunch')
5+
Resque.logger.info('Removing old LtiLaunches')
66
query_started = Time.now.utc
77
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
99
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, " \
1212
"in: #{query_duration.round(3)} seconds")
1313
end
1414
end

config/application.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,9 @@ class Application < Rails::Application
5555

5656
config.launch_nonce_duration = (ENV['LAUNCH_NONCE_DURATION'] || 300).to_i.seconds
5757

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.
6261
config.lti_launch_days_to_delete = (ENV['LTI_LAUNCH_DAYS_TO_DELETE'] || 1).to_i
6362

6463
config.app_name = ENV['APP_NAME'] || 'BbbLtiBroker'

config/jobs_schedule.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
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-
81
remove_old_lti_launch_job:
92
# Every day at 01 GMT -3
103
cron: "0 4 * * *"

0 commit comments

Comments
 (0)