drop-upload: rename 'start' method to 'startService', which is what you're supposed to use to start a Service. refs #1429
This commit is contained in:
parent
f157b73367
commit
10ee22f50e
|
@ -432,7 +432,7 @@ class Client(node.Node, pollmixin.PollMixin):
|
||||||
from allmydata.frontends import drop_upload
|
from allmydata.frontends import drop_upload
|
||||||
s = drop_upload.DropUploader(self, upload_dircap, local_dir_utf8)
|
s = drop_upload.DropUploader(self, upload_dircap, local_dir_utf8)
|
||||||
s.setServiceParent(self)
|
s.setServiceParent(self)
|
||||||
s.start()
|
s.startService()
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
self.log("couldn't start drop-uploader: %r", args=(e,))
|
self.log("couldn't start drop-uploader: %r", args=(e,))
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -59,7 +59,8 @@ class DropUploader(service.MultiService):
|
||||||
mask = inotify.IN_CLOSE_WRITE | inotify.IN_MOVED_TO | inotify.IN_ONLYDIR
|
mask = inotify.IN_CLOSE_WRITE | inotify.IN_MOVED_TO | inotify.IN_ONLYDIR
|
||||||
self._notifier.watch(self._local_path, mask=mask, callbacks=[self._notify])
|
self._notifier.watch(self._local_path, mask=mask, callbacks=[self._notify])
|
||||||
|
|
||||||
def start(self):
|
def startService(self):
|
||||||
|
service.MultiService.startService(self)
|
||||||
d = self._notifier.startReading()
|
d = self._notifier.startReading()
|
||||||
self._stats_provider.count('drop_upload.dirs_monitored', 1)
|
self._stats_provider.count('drop_upload.dirs_monitored', 1)
|
||||||
return d
|
return d
|
||||||
|
|
|
@ -69,7 +69,7 @@ class DropUploadTestMixin(GridTestMixin, ShouldFailMixin, ReallyEqualMixin):
|
||||||
self.upload_dircap = n.get_uri()
|
self.upload_dircap = n.get_uri()
|
||||||
self.uploader = DropUploader(self.client, self.upload_dircap, self.local_dir.encode('utf-8'),
|
self.uploader = DropUploader(self.client, self.upload_dircap, self.local_dir.encode('utf-8'),
|
||||||
inotify=self.inotify)
|
inotify=self.inotify)
|
||||||
return self.uploader.start()
|
return self.uploader.startService()
|
||||||
d.addCallback(_made_upload_dir)
|
d.addCallback(_made_upload_dir)
|
||||||
|
|
||||||
# Write something short enough for a LIT file.
|
# Write something short enough for a LIT file.
|
||||||
|
|
Loading…
Reference in New Issue