コード例 #1
0
def main():
    from pcapi.flask_app import app

    scheduler = BlockingScheduler()
    utils.activate_sentry(scheduler)

    scheduler.add_job(synchronize_titelive_things,
                      "cron", [app],
                      day="*",
                      hour="1")

    scheduler.add_job(synchronize_titelive_thing_descriptions,
                      "cron", [app],
                      day="*",
                      hour="2")

    scheduler.add_job(synchronize_titelive_thing_thumbs,
                      "cron", [app],
                      day="*",
                      hour="3")

    scheduler.add_job(synchronize_titelive_stocks,
                      "cron", [app],
                      day="*",
                      hour="2",
                      minute="30")

    scheduler.start()
コード例 #2
0
def main():
    from pcapi.flask_app import app

    scheduler = BlockingScheduler()
    utils.activate_sentry(scheduler)

    scheduler.add_job(synchronize_allocine_stocks,
                      "cron", [app],
                      day="*",
                      hour="23")

    scheduler.add_job(synchronize_libraires_stocks,
                      "cron", [app],
                      day="*",
                      hour="22")

    scheduler.add_job(synchronize_fnac_stocks,
                      "cron", [app],
                      day="*",
                      hour="1")

    scheduler.add_job(synchronize_praxiel_stocks,
                      "cron", [app],
                      day="*",
                      hour="0")

    scheduler.add_job(pc_old_remote_import_beneficiaries,
                      "cron", [app],
                      day="*")

    scheduler.add_job(pc_remote_import_beneficiaries, "cron", [app], day="*")

    scheduler.add_job(update_booking_used, "cron", [app], day="*", hour="0")

    scheduler.add_job(
        pc_handle_expired_bookings,
        "cron",
        [app],
        day="*",
        hour="5",
    )

    scheduler.add_job(
        pc_notify_soon_to_be_expired_bookings,
        "cron",
        [app],
        day="*",
        hour="5",
        minute="30",
    )

    scheduler.start()
コード例 #3
0
def algolia_clock():
    set_tag("pcapi.app_type", "algolia_clock")
    scheduler = BlockingScheduler()
    utils.activate_sentry(scheduler)

    # ---- Offers ----- #

    scheduler.add_job(
        index_offers_in_algolia_by_offer,
        "cron",
        minute=settings.ALGOLIA_CRON_INDEXING_OFFERS_BY_OFFER_FREQUENCY,
        max_instances=4,
    )

    scheduler.add_job(
        index_offers_in_algolia_by_venue,
        "cron",
        minute=settings.
        ALGOLIA_CRON_INDEXING_OFFERS_BY_VENUE_PROVIDER_FREQUENCY,
    )

    scheduler.add_job(delete_expired_offers_in_algolia,
                      "cron",
                      day="*",
                      hour="1")

    scheduler.add_job(
        index_offers_in_error_in_algolia_by_offer,
        "cron",
        minute=settings.
        ALGOLIA_CRON_INDEXING_OFFERS_IN_ERROR_BY_OFFER_FREQUENCY,
    )

    # ---- Venues ----- #

    scheduler.add_job(
        index_venues,
        "cron",
        minute=settings.CRON_INDEXING_VENUES_FREQUENCY,
    )

    scheduler.add_job(
        index_venues_in_error,
        "cron",
        minute=settings.CRON_INDEXING_VENUES_IN_ERROR_FREQUENCY,
    )

    scheduler.start()
コード例 #4
0
def titelive_clock():
    set_tag("pcapi.app_type", "titelive_clock")
    scheduler = BlockingScheduler()
    utils.activate_sentry(scheduler)

    scheduler.add_job(synchronize_titelive_things, "cron", day="*", hour="1")

    scheduler.add_job(synchronize_titelive_thing_descriptions,
                      "cron",
                      day="*",
                      hour="2")

    scheduler.add_job(synchronize_titelive_thing_thumbs,
                      "cron",
                      day="*",
                      hour="3")

    scheduler.start()
コード例 #5
0
def main():
    from pcapi.flask_app import app

    scheduler = BlockingScheduler()
    utils.activate_sentry(scheduler)

    scheduler.add_job(
        index_offers_in_algolia_by_offer,
        "cron", [app],
        minute=settings.ALGOLIA_CRON_INDEXING_OFFERS_BY_OFFER_FREQUENCY)

    scheduler.add_job(
        index_offers_in_algolia_by_venue_provider,
        "cron",
        [app],
        minute=settings.ALGOLIA_CRON_INDEXING_OFFERS_BY_VENUE_FREQUENCY,
    )

    scheduler.add_job(
        index_offers_in_algolia_by_venue,
        "cron",
        [app],
        minute=settings.
        ALGOLIA_CRON_INDEXING_OFFERS_BY_VENUE_PROVIDER_FREQUENCY,
    )

    scheduler.add_job(delete_expired_offers_in_algolia,
                      "cron", [app],
                      day="*",
                      hour="1")

    scheduler.add_job(
        index_offers_in_error_in_algolia_by_offer,
        "cron",
        [app],
        minute=settings.
        ALGOLIA_CRON_INDEXING_OFFERS_IN_ERROR_BY_OFFER_FREQUENCY,
    )

    scheduler.start()
コード例 #6
0
def clock() -> None:
    set_tag("pcapi.app_type", "clock")
    scheduler = BlockingScheduler()
    utils.activate_sentry(scheduler)

    scheduler.add_job(synchronize_allocine_stocks, "cron", day="*", hour="23")

    scheduler.add_job(synchronize_provider_api, "cron", day="*", hour="1")

    scheduler.add_job(pc_remote_import_beneficiaries,
                      "cron",
                      day="*",
                      hour="21",
                      minute="50")

    scheduler.add_job(pc_remote_import_beneficiaries_from_old_dms,
                      "cron",
                      day="*",
                      hour="20",
                      minute="50")

    scheduler.add_job(pc_import_beneficiaries_from_dms_v3, "cron", hour="*")

    scheduler.add_job(pc_import_beneficiaries_from_dms_v4,
                      "cron",
                      hour="*",
                      minute="20")

    scheduler.add_job(update_booking_used, "cron", day="*", hour="0")

    scheduler.add_job(
        pc_handle_expired_bookings,
        "cron",
        day="*",
        hour="5",
    )

    scheduler.add_job(
        pc_notify_soon_to_be_expired_individual_bookings,
        "cron",
        day="*",
        hour="5",
        minute="30",
    )

    scheduler.add_job(pc_notify_newly_eligible_users,
                      "cron",
                      day="*",
                      hour="3")

    scheduler.add_job(pc_clean_expired_tokens, "cron", day="*", hour="2")

    scheduler.add_job(pc_check_stock_quantity_consistency,
                      "cron",
                      day="*",
                      hour="1")

    scheduler.add_job(pc_send_tomorrow_events_notifications,
                      "cron",
                      day="*",
                      hour="16")

    scheduler.add_job(pc_clean_past_draft_offers, "cron", day="*", hour="20")

    scheduler.add_job(pc_send_withdrawal_terms_to_offerers_validated_yesterday,
                      "cron",
                      day="*",
                      hour="6")

    scheduler.add_job(pc_recredit_underage_users, "cron", day="*", hour="0")

    scheduler.start()