Skip to content

Create scheduling adapter synchronously#27419

Merged
EvanHahn merged 1 commit into
mainfrom
scheduler-adapter-getter-doesnt-need-to-be-async
Apr 15, 2026
Merged

Create scheduling adapter synchronously#27419
EvanHahn merged 1 commit into
mainfrom
scheduler-adapter-getter-doesnt-need-to-be-async

Conversation

@EvanHahn
Copy link
Copy Markdown
Contributor

towards https://linear.app/ghost/issue/NY-1191

We marked the "get scheduling adapter" function asynchronous, but it doesn't need to be. The function itself doesn't await anything, nor does anything downstream.

This change should have no user impact (maybe startup is slightly faster), but it makes an upcoming change slightly easier.

towards https://linear.app/ghost/issue/NY-1191

We marked the "get scheduling adapter" function asynchronous, but it
doesn't need to be. The function itself doesn't `await` anything, nor
does anything downstream.

This change should have no user impact (maybe startup is *slightly*
faster), but it makes an upcoming change slightly easier.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 03519257-86fb-486d-a868-0c1f582ec01e

📥 Commits

Reviewing files that changed from the base of the PR and between 483403c and 6d36780.

📒 Files selected for processing (3)
  • ghost/core/core/server/adapters/scheduling/post-scheduling/index.js
  • ghost/core/core/server/adapters/scheduling/utils.js
  • ghost/core/test/unit/server/adapters/scheduling/utils.test.js

Walkthrough

The createAdapter initialization function in the scheduling adapter system was converted from an asynchronous function to a synchronous function. This change removes the Promise wrapper from the function's return value, allowing direct access to the adapter object. The call site was updated to remove the await keyword, and unit tests were refactored to verify the synchronous behavior using direct assertions and exception handling instead of Promise-based patterns.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Create scheduling adapter synchronously' accurately and clearly summarizes the main change: converting the scheduling adapter creation from an async to a synchronous function.
Description check ✅ Passed The description clearly explains the change (removing async from the scheduling adapter getter), provides context (function doesn't await anything), and explains motivation (simplifies upcoming changes), all directly related to the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch scheduler-adapter-getter-doesnt-need-to-be-async

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

@EvanHahn EvanHahn requested a review from cmraible April 15, 2026 23:36
@EvanHahn EvanHahn merged commit 270b70e into main Apr 15, 2026
44 checks passed
@EvanHahn EvanHahn deleted the scheduler-adapter-getter-doesnt-need-to-be-async branch April 15, 2026 23:44
franky19 pushed a commit to franky19/Ghost that referenced this pull request Apr 18, 2026
towards https://linear.app/ghost/issue/NY-1191

We marked the "get scheduling adapter" function asynchronous, but it
doesn't need to be. The function itself doesn't `await` anything, nor
does anything downstream.

This change should have no user impact (maybe startup is *slightly*
faster), but it makes an upcoming change slightly easier.
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.

2 participants