Perform the asserts earlier

This commit is contained in:
Jean-Paul Calderone 2019-03-06 16:02:20 -05:00
parent ed755cf590
commit 4b0b269b56

View File

@ -1318,17 +1318,16 @@ class Uploader(QueueMixin):
"""
# Uploader
with PROCESS_ITEM(item=item).context():
d = DeferredContext(defer.succeed(False))
relpath_u = item.relpath_u
precondition(isinstance(relpath_u, unicode), relpath_u)
precondition(not relpath_u.endswith(u'/'), relpath_u)
d = DeferredContext(defer.succeed(False))
if relpath_u is None:
item.set_status('invalid_path', self._clock.seconds())
return d.addActionFinish()
item.set_status('started', self._clock.seconds())
precondition(isinstance(relpath_u, unicode), relpath_u)
precondition(not relpath_u.endswith(u'/'), relpath_u)
def _maybe_upload(ign, now=None):
MAYBE_UPLOAD.log(relpath=relpath_u)