forked from mtusi2026/mtusi2026lab4
fix s3 storage
This commit is contained in:
+10
-6
@@ -20,13 +20,13 @@ async def cleanup_once(factory, storage, apply: bool) -> bool:
|
||||
result = await reconcile_attachments(session, storage, dry_run=not apply)
|
||||
print(json.dumps(asdict(result)), flush=True)
|
||||
except RECOVERABLE_STORAGE_ERRORS as error:
|
||||
log_recoverable_error('Reconciliation', error)
|
||||
log_recoverable_error("Reconciliation", error)
|
||||
completed = False
|
||||
return completed
|
||||
|
||||
|
||||
async def run(once: bool, apply: bool) -> None:
|
||||
settings = Settings()
|
||||
settings = Settings() # type: ignore
|
||||
s3_settings = S3Settings()
|
||||
engine = create_db_engine(settings)
|
||||
factory = create_session_factory(engine)
|
||||
@@ -45,12 +45,16 @@ async def run(once: bool, apply: bool) -> None:
|
||||
|
||||
|
||||
def main() -> None:
|
||||
parser = argparse.ArgumentParser(description='Сверка журнала загрузок MinIO/БД')
|
||||
parser.add_argument('--once', action='store_true')
|
||||
parser.add_argument('--apply', action='store_true', help='удалять безопасные кандидаты; по умолчанию dry-run')
|
||||
parser = argparse.ArgumentParser(description="Сверка журнала загрузок MinIO/БД")
|
||||
parser.add_argument("--once", action="store_true")
|
||||
parser.add_argument(
|
||||
"--apply",
|
||||
action="store_true",
|
||||
help="удалять безопасные кандидаты; по умолчанию dry-run",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
asyncio.run(run(args.once, args.apply))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user