fixing base UI crash after completing OP guide for the first time (#337)
old-commit-hash: 401c4026ac78cb454aef7889e11ebe92795d0ac9
This commit is contained in:
@@ -272,6 +272,7 @@ def read_db(params_path, key):
|
||||
return None
|
||||
|
||||
def write_db(params_path, key, value):
|
||||
prev_umask = os.umask(0)
|
||||
lock = FileLock(params_path+"/.lock", True)
|
||||
lock.acquire()
|
||||
|
||||
@@ -286,6 +287,7 @@ def write_db(params_path, key, value):
|
||||
os.rename(tmp_path, path)
|
||||
fsync_dir(os.path.dirname(path))
|
||||
finally:
|
||||
os.umask(prev_umask)
|
||||
lock.release()
|
||||
|
||||
class Params(object):
|
||||
|
||||
Reference in New Issue
Block a user