module TFSGraph::StoreHelpers

Constants

UPDATED_KEY

Public Instance Methods

flush_all() click to toggle source

flush by key so that we only disturbe our namespace

# File lib/tfs_graph/store_helpers.rb, line 9
def flush_all
  RepositoryRegistry.project_repository.drop_all
end
last_updated_on() click to toggle source
# File lib/tfs_graph/store_helpers.rb, line 18
def last_updated_on
  date = redis.get(UPDATED_KEY)
  return Time.at(0).localtime unless date

  Time.parse(date).localtime
end
mark_as_updated(time=nil) click to toggle source
# File lib/tfs_graph/store_helpers.rb, line 13
def mark_as_updated(time=nil)
  time ||= Time.now
  redis.set UPDATED_KEY, time.utc
end

Private Instance Methods

redis() click to toggle source
# File lib/tfs_graph/store_helpers.rb, line 26
def redis
  ServerRegistry.redis
end