Module: TFSGraph::StoreHelpers
- Included in:
- BranchStore, ChangesetStore, GraphPopulator, Populators::Utilities
- Defined in:
- lib/tfs_graph/store_helpers.rb
Constant Summary collapse
- UPDATED_KEY =
"LAST_UPDATED_ON"
Instance Method Summary collapse
-
#flush_all ⇒ Object
flush by key so that we only disturbe our namespace.
- #last_updated_on ⇒ Object
- #mark_as_updated(time = nil) ⇒ Object
Instance Method Details
#flush_all ⇒ Object
flush by key so that we only disturbe our namespace
8 9 10 11 12 |
# File 'lib/tfs_graph/store_helpers.rb', line 8 def flush_all redis.keys("*").each do |k| redis.del k end end |
#last_updated_on ⇒ Object
19 20 21 22 23 24 |
# File 'lib/tfs_graph/store_helpers.rb', line 19 def last_updated_on date = redis.get(UPDATED_KEY) return Time.now unless date Time.parse(date).localtime end |
#mark_as_updated(time = nil) ⇒ Object
14 15 16 17 |
# File 'lib/tfs_graph/store_helpers.rb', line 14 def mark_as_updated(time=nil) time ||= Time.now redis.set UPDATED_KEY, time.utc end |