From be1e4ce05348e722e52c2e68f5b1c1514caa00dd Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Mon, 5 Feb 2018 16:11:03 +0100 Subject: schedule.rb: Abort old imports before import notification As a result of a new requirement, before doing the existing work we were doing in the imports cron job (notifying parent imports), we first need to clear out old imports and mark them as 'aborted'. Refs #4963 --- lib/tasks/imports.rake | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/tasks') diff --git a/lib/tasks/imports.rake b/lib/tasks/imports.rake index 6bc84acc8..fee850b23 100644 --- a/lib/tasks/imports.rake +++ b/lib/tasks/imports.rake @@ -3,4 +3,9 @@ namespace :import do task notify_parent: :environment do ParentImportNotifier.notify_when_finished end + + desc "Mark old unfinished imports as 'aborted'" + task abort_old: :environment do + Import.abort_old + end end -- cgit v1.2.3 From 2e346505cbf2f82c5aaf6fca37966a39b6c9656c Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Mon, 5 Feb 2018 16:54:01 +0100 Subject: imports.rake: Change `abort_old` to `netex_abort_old` After re-reading the ticket, I see now that the aborting of old imports should only apply to `NetexImport`s. Update the code to make this happen. Refs #4963 --- lib/tasks/imports.rake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/tasks') diff --git a/lib/tasks/imports.rake b/lib/tasks/imports.rake index fee850b23..9d0fc8726 100644 --- a/lib/tasks/imports.rake +++ b/lib/tasks/imports.rake @@ -4,8 +4,8 @@ namespace :import do ParentImportNotifier.notify_when_finished end - desc "Mark old unfinished imports as 'aborted'" - task abort_old: :environment do - Import.abort_old + desc "Mark old unfinished Netex imports as 'aborted'" + task netex_abort_old: :environment do + NetexImport.abort_old end end -- cgit v1.2.3