Skip to content

feat: Move sidekiq "stale cleanup" to new before_run service method - #239

Merged
spencewenski merged 1 commit into
mainfrom
gh-238-move-stale-cleanup
Jun 23, 2024
Merged

spencewenski merged 1 commit into
mainfrom
gh-238-move-stale-cleanup

Conversation

@spencewenski

Copy link
Copy Markdown
Member

In order to allow handling CLI commands with services without requiring the sidkiq redis connection to be available, we need to move the "stale cleanup" behavior out of the "build" method so that the service can be built without needing to access redis.

This is accomplished by adding a new AppService::before_run trait method, which is run after all the services are built and before any of the services are run. The sidekiq service's "stale cleanup" behavior is now implemented in this trait method.

This PR also updates the health check API to run the db and redis checks in parallel.

Closes #238

@codecov

codecov Bot commented Jun 23, 2024 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 32.71028% with 72 lines in your changes missing coverage. Please review.

Project coverage is 43.27%. Comparing base (4a336c6) to head (4c3d18e).

Files Coverage Δ
src/app/mod.rs 0.00% <0.00%> (ø)
src/service/mod.rs 25.00% <0.00%> (-15.00%) ⬇️
src/service/worker/sidekiq/builder.rs 52.63% <0.00%> (-2.37%) ⬇️
src/service/runner.rs 0.00% <0.00%> (ø)
src/service/worker/sidekiq/service.rs 48.27% <64.81%> (+14.40%) ⬆️
src/api/core/health.rs 0.00% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4a336c6...4c3d18e. Read the comment docs.

In order to allow handling CLI commands with services without requiring
the sidkiq redis connection to be available, we need to move the "stale
cleanup" behavior out of the "build" method so that the service can be
built without needing to access redis.

This is accomplished by adding a new `AppService::before_run` trait
method, which is run after all the services are built and before any of
the services are run. The sidekiq service's "stale cleanup" behavior is
now implemented in this trait method.

This PR also updates the health check API to run the db and redis checks
in parallel.

Closes #238
@spencewenski
spencewenski force-pushed the gh-238-move-stale-cleanup branch from 473d805 to 4c3d18e Compare June 23, 2024 01:24
@spencewenski
spencewenski merged commit ef6e630 into main Jun 23, 2024
@spencewenski
spencewenski deleted the gh-238-move-stale-cleanup branch June 23, 2024 01:31
@github-actions github-actions Bot mentioned this pull request Jun 23, 2024
spencewenski pushed a commit that referenced this pull request Jun 23, 2024
## 🤖 New release
* `roadster`: 0.3.3 -> 0.3.4

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

<blockquote>

##
[0.3.4](roadster-v0.3.3...roadster-v0.3.4)
- 2024-06-23

### Added
- Add health checks to run before starting services
([#242](#242))
- Add `From` impl to convert db config to ConnectOptions
([#240](#240))
- Move sidekiq "stale cleanup" to new `before_run` service method
([#239](#239))

### Other
- Add dependabot config to update github actions weekly
([#243](#243))
- Update READMEs to use `__` as the env var separator instead of `.`
- Update list of UI frameworks in readme
- Set up `cargo deny`
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/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

1 participant