Class: Spotlight::ValidityChecker

Inherits:
Object
  • Object
show all
Defined in:
app/services/spotlight/validity_checker.rb

Overview

Extension point for downstream applications to override to check if a delayed job still needs to run

Instance Method Summary collapse

Instance Method Details

#check(_job, validity_token: nil) ⇒ boolean

Check if the token is still valid for the model

Parameters:

  • (ActiveJob::Base)
  • the (Object)

    serializable token minted by #mint

Returns:

  • (boolean)


16
17
18
# File 'app/services/spotlight/validity_checker.rb', line 16

def check(_job, validity_token: nil)
  validity_token || true
end

#mint(_job) ⇒ Object

Return a validity token

Parameters:

  • (ActiveJob::Base)

Returns:

  • (Object)

    any serializable object



10
# File 'app/services/spotlight/validity_checker.rb', line 10

def mint(_job); end