forked from M-Labs/artiq
1
0
Fork 0

worker_db: Only warn on repeated archive read if dataset changed

In larger experiments, it is quite natural for the same dataset
to be read from multiple unrelated components. The only situation
where multiple reads from an archived dataset are problematic is
when the valeu actually changes between reads. Hence, this commit
restricts the warning to the latter situation.
This commit is contained in:
David Nadligner 2018-07-11 20:09:18 +01:00 committed by Sébastien Bourdeauducq
parent 4843832329
commit 141fcaaa8a
1 changed files with 3 additions and 3 deletions

View File

@ -227,9 +227,9 @@ class DatasetManager:
else: else:
data = self.ddb.get(key) data = self.ddb.get(key)
if archive: if archive:
if key in self.archive: if self.archive.get(key, data) != data:
logger.warning("Dataset '%s' is already in archive, " logger.warning("Older value of dataset '%s' is already in "
"overwriting", key, stack_info=True) "archive, overwriting", key, stack_info=True)
self.archive[key] = data self.archive[key] = data
return data return data