fix s3 storage

This commit is contained in:
2026-11-04 22:00:11 +03:00
parent 7576ee8c83
commit 5ceab4825e
10 changed files with 274 additions and 108 deletions
+10 -6
View File
@@ -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()