[sync] model build moved to separate step
This commit is contained in:
1 parent
d122d040fe
commit
aecd72847c
1 file changed
+10
-2
@@ -43,12 +43,15 @@ class Sync:
|
|||||||
async def clean(self):
|
async def clean(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def update(self, item):
|
async def build(self, item):
|
||||||
args = self._get_build_args()
|
args = self._get_build_args()
|
||||||
|
|
||||||
await item.build(**args)
|
await item.build(**args)
|
||||||
|
return item
|
||||||
|
|
||||||
|
async def update(self, item):
|
||||||
await item.upload()
|
await item.upload()
|
||||||
await item.save()
|
await item.save()
|
||||||
|
return item
|
||||||
|
|
||||||
def _get_build_args(self):
|
def _get_build_args(self):
|
||||||
return {
|
return {
|
||||||
@@ -101,6 +104,11 @@ class Sync:
|
|||||||
items = await untouched(items)
|
items = await untouched(items)
|
||||||
self.logger.info(f'Ready to process {len(items)} item(s)')
|
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
|
# UPDATING
|
||||||
if self.update_enabled:
|
if self.update_enabled:
|
||||||
for item in items:
|
for item in items:
|
||||||
|
|||||||
Reference in new issue
Block a user