forked from M-Labs/artiq
1
0
Fork 0

master/dataset_db: support keeping old persist flag

This commit is contained in:
Sebastien Bourdeauducq 2016-07-03 12:19:01 +08:00
parent 4c8a8357b0
commit fdc25777da
1 changed files with 6 additions and 1 deletions

View File

@ -57,7 +57,12 @@ class DatasetDB(TaskObject):
process_mod(self.data, mod) process_mod(self.data, mod)
# convenience functions (update() can be used instead) # convenience functions (update() can be used instead)
def set(self, key, value, persist=False): def set(self, key, value, persist=None):
if persist is None:
if key in self.data.read:
persist = self.data.read[key][0]
else:
persist = False
self.data[key] = (persist, value) self.data[key] = (persist, value)
def delete(self, key): def delete(self, key):