Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/bulk_imports/tracker.rb')
-rw-r--r--app/models/bulk_imports/tracker.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/bulk_imports/tracker.rb b/app/models/bulk_imports/tracker.rb
index 55502721a76..d1a6f3b9a80 100644
--- a/app/models/bulk_imports/tracker.rb
+++ b/app/models/bulk_imports/tracker.rb
@@ -24,6 +24,7 @@ class BulkImports::Tracker < ApplicationRecord
delegate :file_extraction_pipeline?, to: :pipeline_class
DEFAULT_PAGE_SIZE = 500
+ STALE_AFTER = 4.hours
scope :next_pipeline_trackers_for, -> (entity_id) {
entity_scope = where(bulk_import_entity_id: entity_id)
@@ -89,4 +90,8 @@ class BulkImports::Tracker < ApplicationRecord
transition [:created, :started] => :timeout
end
end
+
+ def stale?
+ created_at < STALE_AFTER.ago
+ end
end