Class: ProjectExportJob

Inherits:
ApplicationRecord show all
Includes:
EachBatch
Defined in:
app/models/project_export_job.rb

Constant Summary collapse

EXPIRES_IN =
7.days
STATUS =
{
  queued: 0,
  started: 1,
  finished: 2,
  failed: 3
}.freeze

Constants inherited from ApplicationRecord

ApplicationRecord::MAX_PLUCK

Constants included from ResetOnUnionError

ResetOnUnionError::MAX_RESET_PERIOD

Class Method Summary collapse

Methods inherited from ApplicationRecord

cached_column_list, #create_or_load_association, declarative_enum, default_select_columns, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order

Methods included from SensitiveSerializableHash

#serializable_hash

Class Method Details

.prune_expired_jobsObject



42
43
44
45
46
# File 'app/models/project_export_job.rb', line 42

def prune_expired_jobs
  prunable.each_batch do |relation| # rubocop:disable Style/SymbolProc
    relation.delete_all
  end
end