Prevent message write race among different processes touching the same message
This commit is contained in:
parent
bf924c739c
commit
5be161cb1e
1 changed files with 1 additions and 1 deletions
|
|
@ -674,7 +674,7 @@ class LXMessage:
|
||||||
def write_to_directory(self, directory_path):
|
def write_to_directory(self, directory_path):
|
||||||
file_name = RNS.hexrep(self.hash, delimit=False)
|
file_name = RNS.hexrep(self.hash, delimit=False)
|
||||||
file_path = directory_path+"/"+file_name
|
file_path = directory_path+"/"+file_name
|
||||||
tmp_path = file_path+".tmp."+str(os.getpid() or time.time())
|
tmp_path = file_path+".tmp."+str(os.getpid() or time.time())+"."+RNS.hexrep(os.urandom(8), delimit=False)
|
||||||
|
|
||||||
with self.__persist_lock:
|
with self.__persist_lock:
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue