Module: BulkImports::Pipeline::IndexCacheStrategy

Included in:
NdjsonPipeline
Defined in:
lib/bulk_imports/pipeline/index_cache_strategy.rb

Instance Method Summary collapse

Instance Method Details

#already_processed?(_, index) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
9
# File 'lib/bulk_imports/pipeline/index_cache_strategy.rb', line 6

def already_processed?(_, index)
  last_index = Gitlab::Cache::Import::Caching.read(cache_key)
  last_index && last_index.to_i >= index
end

#save_processed_entry(_, index) ⇒ Object



11
12
13
# File 'lib/bulk_imports/pipeline/index_cache_strategy.rb', line 11

def save_processed_entry(_, index)
  Gitlab::Cache::Import::Caching.write(cache_key, index)
end