feat: ability to reset marketplace

This commit is contained in:
2024-11-11 10:41:51 +03:00
parent 8cb94d06bf
commit 4841578dee
7 changed files with 47 additions and 2 deletions

View File

@@ -132,3 +132,11 @@ class StocksUpdater:
for marketplace_id, marketplace_updates in updates_list:
tasks.append(self.update_marketplace(marketplace_id, marketplace_updates))
await asyncio.gather(*tasks)
async def reset_marketplace(self, marketplace_id:int):
marketplace = await self.get_marketplace(marketplace_id)
start = time.time()
updater = UpdaterFactory.get_updater(self.session,marketplace)
await updater.reset()
logging.info(
f"{marketplace.name} successfully updated in {round(time.time() - start, 2)} seconds.")