mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-31 08:25:35 +00:00
Show last time for successful scans too
This commit is contained in:
parent
8a33fc612a
commit
75a218d80f
@ -763,14 +763,16 @@ class Downloader(QueueMixin, WriteFileMixin):
|
|||||||
break
|
break
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
last_try = format_time(datetime.fromtimestamp(self._clock.seconds()).timetuple())
|
|
||||||
self._status_reporter(
|
self._status_reporter(
|
||||||
False, "Initial scan has failed",
|
False, "Initial scan has failed",
|
||||||
"Last tried at %s" % last_try,
|
"Last tried at %s" % self.nice_current_time(),
|
||||||
)
|
)
|
||||||
twlog.msg("Magic Folder failed initial scan: %s" % (e,))
|
twlog.msg("Magic Folder failed initial scan: %s" % (e,))
|
||||||
yield task.deferLater(self._clock, self.scan_interval, lambda: None)
|
yield task.deferLater(self._clock, self.scan_interval, lambda: None)
|
||||||
|
|
||||||
|
def nice_current_time(self):
|
||||||
|
return format_time(datetime.fromtimestamp(self._clock.seconds()).timetuple())
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
self._log("stop")
|
self._log("stop")
|
||||||
self._stopped = True
|
self._stopped = True
|
||||||
@ -857,8 +859,10 @@ class Downloader(QueueMixin, WriteFileMixin):
|
|||||||
scan_batch[relpath_u] += [(file_node, metadata)]
|
scan_batch[relpath_u] += [(file_node, metadata)]
|
||||||
else:
|
else:
|
||||||
scan_batch[relpath_u] = [(file_node, metadata)]
|
scan_batch[relpath_u] = [(file_node, metadata)]
|
||||||
last_try = format_time(datetime.fromtimestamp(self._clock.seconds()).timetuple())
|
self._status_reporter(
|
||||||
self._status_reporter(True, 'Magic folder is working', 'Last attempt: %s' % last_try)
|
True, 'Magic folder is working',
|
||||||
|
'Last scan: %s' % self.nice_current_time(),
|
||||||
|
)
|
||||||
|
|
||||||
d.addCallback(scan_listing)
|
d.addCallback(scan_listing)
|
||||||
d.addBoth(self._logcb, "end of _scan_remote_dmd")
|
d.addBoth(self._logcb, "end of _scan_remote_dmd")
|
||||||
@ -914,14 +918,16 @@ class Downloader(QueueMixin, WriteFileMixin):
|
|||||||
x = None
|
x = None
|
||||||
try:
|
try:
|
||||||
x = yield self._scan(None)
|
x = yield self._scan(None)
|
||||||
self._status_reporter(True, 'Magic folder is working')
|
self._status_reporter(
|
||||||
|
True, 'Magic folder is working',
|
||||||
|
'Last scan: %s' % self.nice_current_time(),
|
||||||
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
twlog.msg("Remote scan failed: %s" % (e,))
|
twlog.msg("Remote scan failed: %s" % (e,))
|
||||||
self._log("_scan failed: %s" % (repr(e),))
|
self._log("_scan failed: %s" % (repr(e),))
|
||||||
last_try = format_time(datetime.fromtimestamp(self._clock.seconds()).timetuple())
|
|
||||||
self._status_reporter(
|
self._status_reporter(
|
||||||
False, 'Remote scan has failed: %s' % str(e),
|
False, 'Remote scan has failed: %s' % str(e),
|
||||||
'Last attempted at %s' % last_try,
|
'Last attempted at %s' % self.nice_current_time(),
|
||||||
)
|
)
|
||||||
defer.returnValue(x)
|
defer.returnValue(x)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user