MAILTO=avia-api-cron@yandex-team.ru
CONTENT_TYPE="text/plain; charset=utf-8"
TIMEOUT=/usr/bin/timeout
SHELL=/bin/bash
CLEAN=/app/scripts/without_sentry_bullshit.sh
PROJECT_PATH=/app

AVIA_CRON_JOB=1

# push notifications every minute
* * * * * root ${PROJECT_PATH}/bin/manage push_aeroexpress_notifications | $CLEAN

# update min_prices every hour
0 * * * * root ${PROJECT_PATH}/bin/manage update_min_prices | $CLEAN

# cache currency rates
*/10 * * * * root yt_lock.py ${YT_LOCK_PREFIX}/cache_currency_rates --proxy ${YT_LOCK_PROXY} --create-lock "${PROJECT_PATH}/bin/manage_django cache_currency_rates | $CLEAN"

# send push statistics to agave (RASPTICKETS-4839)
*/10 * * * * root ${TIMEOUT} -s 9 120 ${SHELL} ${PROJECT_PATH}/scripts/send_push_statistics.sh

# send request by api key statistics to agave (RASPTICKETS-4957)
*/10 * * * * root ${TIMEOUT} -s 9 120 ${SHELL} ${PROJECT_PATH}/scripts/send_request_by_app_key_statistics.sh

# send emails
0 16 * * * root ${PROJECT_PATH}/bin/manage send_emails | $CLEAN

# update min_prices for email subscriptions
0 * * * * root if [[ "$QLOUD_DATACENTER" != "MAN" ]]; then yt_lock.py ${YT_LOCK_PREFIX}/update_subscriptions --proxy ${YT_LOCK_PROXY} --create-lock "${PROJECT_PATH}/bin/manage update_subscriptions | $CLEAN"; fi

# run subscriptions heater
0 6,11 * * * root ${PROJECT_PATH}/bin/manage preheat_subscriptions | $CLEAN
