Skip to content

Schedule source shouldn't delete existing schedules during startup #65

Done

Description

@danfimov

taskiq-postgres version

0.9.0

Python version

Python 3.11 or lower

PostgreSQL driver

asyncpg

PostgreSQL version

All

What happened?

AsyncpgScheduleSource.startup() truncates ALL schedules — dynamic schedules added via add_schedule() can't survive a restart when mixed with label crons

Expected behavior

We should not touch at least dynamic schedules.

I see two potential solutions here:

  • mark dynamic / static schedules in database and delete only static onces
  • add flag to just skip all logic about truncate + recreate at once.

UPDATE: Let's just drop logic about finding schedules (let LabelScheduleSource do that) and just never delete any schedules that live in our db.

Steps to reproduce

Just call startup() + add schedule + restart broker with schedule source

Minimal code example

Relevant log output

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions