Class: Stash::Harvester::Resync::ResyncHarvestTask

Inherits:
HarvestTask
  • Object
show all
Defined in:
lib/stash/harvester/resync/resync_harvest_task.rb

Overview

Class representing a single ResourceSync harvest operation. If a time range (open or closed) is provided, the task will harvest changes in that time range; otherwise, it will harvest all resources. ChangeDumps and ResourceDumps are preferred to ChangeLists and ResourceLists, ChangeListIndices etc. will be transparently crawled to reach the nested lists.

Constant Summary collapse

JULIAN_YEAR_SECONDS =

Added to the current time to create an end timestamp for open ranges

365.25 * 86_400

Instance Attribute Summary

Attributes inherited from HarvestTask

#config, #from_time, #until_time

Instance Method Summary collapse

Constructor Details

#initialize(config:, from_time: nil, until_time: nil) ⇒ ResyncHarvestTask

Creates a new IncrementalSyncTask for synchronizing with the set of resources whose capabilities are enumerated by the specified capability list


37
38
39
# File 'lib/stash/harvester/resync/resync_harvest_task.rb', line 37

def initialize(config:, from_time: nil, until_time: nil)
  super
end

Instance Method Details

#harvest_recordsEnumerator::Lazy<ResyncRecord>

Harvests the records from the ResourceSync source.


46
47
48
49
# File 'lib/stash/harvester/resync/resync_harvest_task.rb', line 46

def harvest_records
  resources = time_range ? all_changes : all_resources
  resources.map { |r| ResyncRecord.new(r) }
end