fixing base UI crash after completing OP guide for the first time (#337)

old-commit-hash: 401c4026ac78cb454aef7889e11ebe92795d0ac9
This commit is contained in:
rbiasini
2018-08-27 10:43:23 -07:00
committed by GitHub
parent a2f5dddb1f
commit bb9cba24b7

View File

@@ -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):