From 8ac63cf5bd82d875678103c09584391c23968e31 Mon Sep 17 00:00:00 2001 From: meejah Date: Mon, 15 Jan 2018 18:10:02 -0700 Subject: [PATCH] only keep history for items that are processed --- src/allmydata/frontends/magic_folder.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/allmydata/frontends/magic_folder.py b/src/allmydata/frontends/magic_folder.py index 07bf387ca..cde34baf8 100644 --- a/src/allmydata/frontends/magic_folder.py +++ b/src/allmydata/frontends/magic_folder.py @@ -432,8 +432,11 @@ class QueueMixin(HookMixin): self._log(" processing '%r'" % (item,)) proc = yield self._process(item) self._log(" done: %r" % proc) + if not proc: + self._process_history.remove(item) except Exception as e: log.err("processing '%r' failed: %s" % (item, e)) + item.set_status('failed', self._clock.seconds()) proc = Failure() self._call_hook(proc, 'processed') @@ -668,6 +671,10 @@ class Uploader(QueueMixin): self._call_hook(path, 'inotify') def _process(self, item): + """ + process a single QueuedItem. If this returns False, the item is + removed from _process_history + """ # Uploader relpath_u = item.relpath_u self._log("_process(%r)" % (relpath_u,))