Class: Dis::Jobs::ChangeType

Inherits:
ActiveJob::Base
  • Object
show all
Defined in:
lib/dis/jobs/change_type.rb

Overview

Dis ChangeType Job

Handles delayed object type change. Stores the content under the new type in delayed layers, then deletes it under the old type. Retries up to 10 times on failure.

Examples:

Dis::Jobs::ChangeType.perform_later("old", "new", key)

Instance Method Summary collapse

Instance Method Details

#perform(prev_type, new_type, key) ⇒ void

This method returns an undefined value.

Parameters:

  • prev_type (String)

    the current type scope

  • new_type (String)

    the new type scope

  • key (String)

    the content hash



22
23
24
25
# File 'lib/dis/jobs/change_type.rb', line 22

def perform(prev_type, new_type, key)
  Dis::Storage.delayed_store(new_type, key)
  Dis::Storage.delayed_delete(prev_type, key)
end