mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-05-04 21:57:48 +08:00
nano level precision
This commit is contained in:
parent
8dae81c5ed
commit
57a46f46a0
@ -96,7 +96,7 @@ func (rc *ReaderCache) ReadChunkAt(buffer []byte, fileId string, cipherKey []byt
|
|||||||
|
|
||||||
// clean up old downloaders
|
// clean up old downloaders
|
||||||
if len(rc.downloaders) >= rc.limit {
|
if len(rc.downloaders) >= rc.limit {
|
||||||
oldestFid, oldestTime := "", time.Now().Unix()
|
oldestFid, oldestTime := "", time.Now().UnixNano()
|
||||||
for fid, downloader := range rc.downloaders {
|
for fid, downloader := range rc.downloaders {
|
||||||
completedTime := atomic.LoadInt64(&downloader.completedTimeNew)
|
completedTime := atomic.LoadInt64(&downloader.completedTimeNew)
|
||||||
if completedTime > 0 && completedTime < oldestTime {
|
if completedTime > 0 && completedTime < oldestTime {
|
||||||
@ -179,7 +179,7 @@ func (s *SingleChunkCacher) startCaching() {
|
|||||||
if s.shouldCache {
|
if s.shouldCache {
|
||||||
s.parent.chunkCache.SetChunk(s.chunkFileId, s.data)
|
s.parent.chunkCache.SetChunk(s.chunkFileId, s.data)
|
||||||
}
|
}
|
||||||
atomic.StoreInt64(&s.completedTimeNew, time.Now().Unix())
|
atomic.StoreInt64(&s.completedTimeNew, time.Now().UnixNano())
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user