From 522ebd2cb10fc2efca1d0dbfc3d73c2a3b5a6a04 Mon Sep 17 00:00:00 2001 From: Dan Nguyen <186835528+dnguyen1-pass@users.noreply.github.com> Date: Wed, 13 Nov 2024 17:10:22 +0100 Subject: [PATCH] (BSR)[API] script: sync titelive book with higher statement_timeout --- api/src/pcapi/scripts/titelive_book_sync/main.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 api/src/pcapi/scripts/titelive_book_sync/main.py diff --git a/api/src/pcapi/scripts/titelive_book_sync/main.py b/api/src/pcapi/scripts/titelive_book_sync/main.py new file mode 100755 index 00000000000..f942cc3aa12 --- /dev/null +++ b/api/src/pcapi/scripts/titelive_book_sync/main.py @@ -0,0 +1,15 @@ +import datetime + +import sqlalchemy as sa + +from pcapi.core.providers.titelive_book_search import TiteliveBookSearch +from pcapi.models import db + + +if __name__ == "__main__": + from pcapi.flask_app import app + + app.app_context().push() + + db.session.execute(sa.text("set session statement_timeout = '400s'")) + TiteliveBookSearch().synchronize_products(datetime.date(2025, 1, 6), datetime.date(2025, 1, 7), 129)