Skip to content

fix!: Create separate PeriodicJob that's only needed for pg worker - #865

Merged
spencewenski merged 5 commits into
mainfrom
gh-864-diff-job-struct
Jul 20, 2025
Merged

fix!: Create separate PeriodicJob that's only needed for pg worker#865
spencewenski merged 5 commits into
mainfrom
gh-864-diff-job-struct

Conversation

@spencewenski

@spencewenski spencewenski commented Jul 20, 2025

Copy link
Copy Markdown
Member

We were biasing a little too much toward having a reusable Job struct to use for all use cases. This made it a little awkward to use for the periodic implementation in the pg worker, and added unnecessary data to the jobs enqueued in the periodic implementation of the sidekiq worker.

This PR adds a new PeriodicJob struct that's very similar to the Job struct, but adds a periodic field for the periodic data. This new struct is only needed by the pg worker currently.

Because the periodic config is moved out of the metadata field, the unique index and delete query for the periodic table needed to change. This PR also removes an enum variant that is no longer needed. Both of these require marking this as a breaking change.

Closes #864

We were biasing a little too much toward having a reusable `Job` struct
to use for all use cases. This made it a little awkward to use for the
periodic implementation in the pg worker, and added unnecessary data to
the jobs enqueued in the periodic implementation of the sidekiq worker.

This PR adds a new `PeriodicJob` struct that's very similar to the `Job`
struct, but adds a `periodic` field for the periodic data. This new
struct is only needed by the pg worker currently.

Because the periodic config is moved out of the `metadata` field, the
unique index and delete query for the periodic table needed to change,
hence marking this as a breaking change.

Closes #864
@spencewenski
spencewenski merged commit 41274c4 into main Jul 20, 2025
@spencewenski
spencewenski deleted the gh-864-diff-job-struct branch July 20, 2025 05:54
spencewenski pushed a commit that referenced this pull request Jul 20, 2025
## 🤖 New release

* `roadster`: 0.8.0-rc.2 -> 0.8.0-rc.3 (⚠ API breaking changes)

### ⚠ `roadster` breaking changes

```text
--- failure enum_variant_missing: pub enum variant removed or renamed ---

Description:
A publicly-visible enum has at least one variant that is no longer available under its prior name. It may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/enum_variant_missing.ron

Failed in:
  variant EnqueueError::PeriodicJobMissingSchedule, previously in file /tmp/.tmp5z5JcY/roadster/src/error/worker.rs:50
```

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

##
[0.8.0-rc.3](roadster-v0.8.0-rc.2...roadster-v0.8.0-rc.3)
- 2025-07-20

### Fixed

- [**breaking**] Create separate `PeriodicJob` that's only needed for pg
worker ([#865](#865))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Different job struct for sidekiq

1 participant