Skip to content

Collect events and weather every day #70

Open

Description

@selvarajuv

Blocked by: #69

Problem

PredictHQ only returns roughly the last 90 days of events, so every day we don't save them is history lost for good. Nothing runs on a schedule today: events and weather only refresh when someone calls the ingest endpoints.

Goal

Events and the weather forecast refresh automatically every day for every hotel, so event history builds up for training and the data behind recommendations stays current.

Scope

  • Choose where the scheduler runs: an external cron (e.g. GitHub Actions) calling the API, an in-process scheduler, or a Neon cron trigger.
  • Run the existing no-dates refresh (POST /hotels/{id}/ingest/events and /ingest/weather) for every hotel, at least daily.
  • Make the schedule easy to change, so events can later run several times a day.
  • Make failed or stopped runs visible to the team (an alert, or a daily summary).
  • A README section on what runs when and how to run it by hand.

Considerations

  • Jobs run inside the API process and die on restart; an external cron survives restarts and is the simplest option.
  • A request while the same job is already running returns 409; treat that as fine, not a failure.
  • How often: events should be fresh within hours, but PredictHQ credits are limited. Start daily and measure credit use before running more often.
  • This is urgent because lost event history can't be recovered. If deployment is slow, run the daily events refresh against a dev database in the meantime.

Acceptance criteria

  • Events and weather refresh daily for every hotel without anyone calling the API.
  • A failed run is visible to the team within a day.
  • A 409 doesn't count as a failure.
  • Daily PredictHQ credit use is measured and written down.

Activity

  1. added
    featureIntroduces a new and complete feature
    plumbingPlumbing and integration: CORS, settings, deploy, scheduler, CI, tests, frontend-API wiring
    on Oct 21, 2026
  2. changed the title [-]Rates refresh by themselves and show when they were last updated[/-] [+]Collect events and weather every day[/+] on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureIntroduces a new and complete featureplumbingPlumbing and integration: CORS, settings, deploy, scheduler, CI, tests, frontend-API wiring

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions