class

Task::CollectFeedDrafts

Inherits Task::Singleton < Task < Ktistec::Model::Polymorphic < Ktistec::Model::Common < Ktistec::Model < Reference < Object

Collection task for abandoned feed drafts.

Drafts are destroyed one at a time, through the model, so Feed#before_destroy deletes each draft's verdicts and materialized rows.

Constants

DEFAULT_MAX_AGE_HOURS = 24 * 7

generous because the lease is renewed by saving, not by viewing: revisiting a draft without previewing it does not save it.

Log = ::Log.for(self)

Constructors

current_instance

Returns the current active instance of this singleton task.

Creates and saves a new instance if no active instance exists.

Source

Class methods

ensure_scheduled

Ensures the singleton task is scheduled.

Typically called on server startup to ensure singleton tasks are created and scheduled.

Source
find_active

Finds the active instance.

Returns nil if no active instance exists.

Source

Instance methods

perform(max_age_hours = DEFAULT_MAX_AGE_HOURS)
Source