File tree 2 files changed +5
-6
lines changed
2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -494,7 +494,7 @@ def murder_workers(self):
494
494
workers = list (self .WORKERS .items ())
495
495
for (pid , worker ) in workers :
496
496
try :
497
- if time .time () - worker .tmp .last_update () <= self .timeout :
497
+ if time .monotonic () - worker .tmp .last_update () <= self .timeout :
498
498
continue
499
499
except (OSError , ValueError ):
500
500
continue
Original file line number Diff line number Diff line change 4
4
# See the NOTICE for more information.
5
5
6
6
import os
7
+ import time
7
8
import platform
8
9
import tempfile
9
10
@@ -35,14 +36,12 @@ def __init__(self, cfg):
35
36
os .close (fd )
36
37
raise
37
38
38
- self .spinner = 0
39
-
40
39
def notify (self ):
41
- self . spinner = ( self . spinner + 1 ) % 2
42
- os .fchmod (self ._tmp .fileno (), self . spinner )
40
+ new_time = time . monotonic ()
41
+ os .utime (self ._tmp .name , ( new_time , new_time ) )
43
42
44
43
def last_update (self ):
45
- return os .fstat (self ._tmp .fileno ()).st_ctime
44
+ return os .fstat (self ._tmp .fileno ()).st_mtime
46
45
47
46
def fileno (self ):
48
47
return self ._tmp .fileno ()
You can’t perform that action at this time.
0 commit comments