mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-22 10:20:59 +00:00
convert start_uploading
This commit is contained in:
parent
28a4a61dab
commit
2761d38ce2
@ -639,6 +639,13 @@ STOP_MONITORING = ActionType(
|
|||||||
u"Uploader is terminating filesystem monitoring operation.",
|
u"Uploader is terminating filesystem monitoring operation.",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
START_UPLOADING = ActionType(
|
||||||
|
u"magic-folder:start-uploading",
|
||||||
|
[_NICKNAME, _DIRECTION],
|
||||||
|
[],
|
||||||
|
u"Uploader is performing startup-time inspection of known files.",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class QueueMixin(HookMixin):
|
class QueueMixin(HookMixin):
|
||||||
"""
|
"""
|
||||||
@ -974,17 +981,20 @@ class Uploader(QueueMixin):
|
|||||||
return d.addActionFinish()
|
return d.addActionFinish()
|
||||||
|
|
||||||
def start_uploading(self):
|
def start_uploading(self):
|
||||||
self._log("start_uploading")
|
action = START_UPLOADING(
|
||||||
|
nickname=self._client.nickname,
|
||||||
|
direction=self._name,
|
||||||
|
)
|
||||||
|
with action:
|
||||||
self.is_ready = True
|
self.is_ready = True
|
||||||
|
|
||||||
all_relpaths = self._db.get_all_relpaths()
|
all_relpaths = self._db.get_all_relpaths()
|
||||||
self._log("all relpaths: %r" % (all_relpaths,))
|
|
||||||
|
|
||||||
for relpath_u in all_relpaths:
|
for relpath_u in all_relpaths:
|
||||||
self._add_pending(relpath_u)
|
self._add_pending(relpath_u)
|
||||||
|
|
||||||
self._full_scan()
|
self._full_scan()
|
||||||
return self._begin_processing()
|
self._begin_processing()
|
||||||
|
|
||||||
def _scan_delay(self):
|
def _scan_delay(self):
|
||||||
return self._pending_delay
|
return self._pending_delay
|
||||||
|
Loading…
x
Reference in New Issue
Block a user