[sync] model build moved to separate step

This commit is contained in:
tmshv committed 2019-10-14 21:07:23 +03:00
1 parent d122d040fe
commit aecd72847c
1 file changed
+10 -2
+10 -2
View File
@@ -43,12 +43,15 @@ class Sync:
async def clean(self):
pass
async def update(self, item):
async def build(self, item):
args = self._get_build_args()
await item.build(**args)
return item
async def update(self, item):
await item.upload()
await item.save()
return item
def _get_build_args(self):
return {
@@ -101,6 +104,11 @@ class Sync:
items = await untouched(items)
self.logger.info(f'Ready to process {len(items)} item(s)')
# BUILDING
for item in items:
self.logger.info(f'Build Item {item}')
await self.build(item)
# UPDATING
if self.update_enabled:
for item in items: