simonw / big-local-datasette

Publishing a Datasette of open projects from biglocalnews.org
https://biglocal.datasettes.com/
2 stars 0 forks source link

Delete table if the CSV for it starts to 404 #11

Closed simonw closed 4 years ago

simonw commented 4 years ago

Maybe just have one run every 24 hours using equivalent of REFRESH_DBS

simonw commented 4 years ago

Asked a question about how best to do that: https://github.community/t5/GitHub-Actions/Schedule-once-an-hour-but-do-something-different-once-a-day/m-p/54350#M9148

simonw commented 4 years ago

Got a great answer there from @BrightRan:

on:
  schedule:
    - cron: '0 1-23 * * *'
    - cron: '0 0 * * *'

jobs:
  test_schedule:
    name: Test schedule
    runs-on: ubuntu-latest
    steps:
      - name: Skip this step every 24 hours
        if: github.event_name == 'schedule' && github.event.schedule != '0 0 * * *'
        run: echo "This step will be skipped every 24 hours"
simonw commented 4 years ago

Leaving this open until I've seen it work in the logs.

simonw commented 4 years ago

This should happen in 8 minutes time - if it does I'll close the ticket.

simonw commented 4 years ago

Ooops messed that up - I forgot to update the if condition.

simonw commented 4 years ago

Cancelled that workflow for the above commit. Now waiting 5 mins to see if it runs on the special schedule.

simonw commented 4 years ago

https://github.com/simonw/big-local-datasette/runs/596115931?check_suite_focus=true it worked!

Run_daily_refresh_at_5_20pm_UTC_refs__11_·_simonw_big-local-datasette_181de90