diff options
| author | chrislu <chris.lu@gmail.com> | 2022-08-26 16:55:15 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-08-26 16:55:15 -0700 |
| commit | 57a46f46a0465db30d6a8906c367da5071a327e7 (patch) | |
| tree | 3ff5604eaa8a732c383f49d3a4913d1f10d02bac | |
| parent | 8dae81c5edaea2b25a79d49c4a08ffadfdc6fddc (diff) | |
| download | seaweedfs-57a46f46a0465db30d6a8906c367da5071a327e7.tar.xz seaweedfs-57a46f46a0465db30d6a8906c367da5071a327e7.zip | |
nano level precision
| -rw-r--r-- | weed/filer/reader_cache.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/weed/filer/reader_cache.go b/weed/filer/reader_cache.go index 89db04eb0..cb89c03c5 100644 --- a/weed/filer/reader_cache.go +++ b/weed/filer/reader_cache.go @@ -96,7 +96,7 @@ func (rc *ReaderCache) ReadChunkAt(buffer []byte, fileId string, cipherKey []byt // clean up old downloaders if len(rc.downloaders) >= rc.limit { - oldestFid, oldestTime := "", time.Now().Unix() + oldestFid, oldestTime := "", time.Now().UnixNano() for fid, downloader := range rc.downloaders { completedTime := atomic.LoadInt64(&downloader.completedTimeNew) if completedTime > 0 && completedTime < oldestTime { @@ -179,7 +179,7 @@ func (s *SingleChunkCacher) startCaching() { if s.shouldCache { s.parent.chunkCache.SetChunk(s.chunkFileId, s.data) } - atomic.StoreInt64(&s.completedTimeNew, time.Now().Unix()) + atomic.StoreInt64(&s.completedTimeNew, time.Now().UnixNano()) return } |
