• GitHub
  • Documentation
  • Discord
  • Tip
search
  • chevron_right Threads
  • label Support

Cron jobs on Heroku

m2712
June 2, 2018
chat_bubble_outline 4
  • link
    m2712
    Members 50 posts
    June 2, 2018, 3:54 p.m. June 2, 2018, 3:54 p.m.
    link

    Hi Rafalp,

    I'm going to deploy the app on Heroku, where Cron is not available. I have two options, Heroku Scheduler (easy) or something like APScheduler (more complex).
    If i'm going the Heroku Scheduler route, there is a limitation in the time intervals.

    These exact intervals isn't available.

    15 0 * * python manage.py prunecategories
    25 0 *
    * python manage.py buildactivepostersranking
    25 0 * * python manage.py clearattachments
    25 0 *
    * python manage.py clearreadtracker
    25 0 * * python manage.py clearsessions
    25 0 *
    * python manage.py invalidatebans
    0 1 * * * python manage.py deletemarkedusers

    It would have to be something like this:

    00:00 python manage.py prunecategories
    00:30 * * python manage.py buildactivepostersranking
    00:30 *
    * python manage.py clearattachments
    00:30 * * python manage.py clearreadtracker
    00:30 *
    * python manage.py clearsessions
    00:30 * * python manage.py invalidatebans
    01:00 *
    * python manage.py deletemarkedusers

    Is this going to be a problem?

    Best regards
    Mike

  • link
    rafalp
    Project Lead 2028 posts
    June 2, 2018, 4 p.m. June 2, 2018, 4 p.m.
    link

    No problem at all.

    mike likes this.

    favorite 1

  • link
    rafalp
    Project Lead 2028 posts
    June 3, 2018, 10:28 p.m. June 3, 2018, 10:28 p.m.
    link

    Just short reminder when it comes to Heroku, Heroku needs special configuration for file uploads to work. ;)

    mike likes this.

    favorite 1

  • link
    m2712
    Members 50 posts
    June 3, 2018, 11 p.m. June 3, 2018, 11 p.m.
    link
    @rafalp

    Just short reminder when it comes to Heroku, Heroku needs special configuration for file uploads to work. ;)

    I was aware of that. But thanks for making sure :-)

    rafalp likes this.

    favorite 1

  • link
    einarf
    Devs & Contributors 23 posts
    June 25, 2018, 2:51 a.m. June 25, 2018, 2:51 a.m.
    link

    Just run them in a sequence like in the Misago-Docker project : github.com/rafalp/Misago-Docker/blob/master/misagodocker/maintenance.sh

    Adding times like that might mean they run in parallel. You don't want that to happen.

arrow_upward Go to top
  • This site uses cookies to gather statistical data for use in traffic analysis.
  • GitHub
  • Documentation
  • Discord
  • Tip
  • Terms of service
  • Privacy policy
powered by misago