MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / BlockNotStale

Method BlockNotStale

tensorflow/core/platform/cloud/ram_file_block_cache.cc:24–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22namespace tensorflow {
23
24bool RamFileBlockCache::BlockNotStale(const std::shared_ptr<Block>& block) {
25 mutex_lock l(block->mu);
26 if (block->state != FetchState::FINISHED) {
27 return true; // No need to check for staleness.
28 }
29 if (max_staleness_ == 0) return true; // Not enforcing staleness.
30 return env_->NowSeconds() - block->timestamp <= max_staleness_;
31}
32
33std::shared_ptr<RamFileBlockCache::Block> RamFileBlockCache::Lookup(
34 const Key& key) {

Callers

nothing calls this directly

Calls 1

NowSecondsMethod · 0.45

Tested by

no test coverage detected