Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

通过 env 调节调度周期 #684

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

通过 env 调节调度周期 #684

wants to merge 1 commit into from

Conversation

felinae98
Copy link
Collaborator

@felinae98 felinae98 commented Jan 26, 2025

This change is Reviewable

@felinae98 felinae98 added the enhancement New feature or request label Jan 26, 2025
@felinae98 felinae98 requested a review from AzideCupric January 26, 2025 16:03
Copy link

netlify bot commented Jan 26, 2025

Deploy Preview for nonebot-bison ready!

Name Link
🔨 Latest commit 4921621
🔍 Latest deploy log https://app.netlify.com/sites/nonebot-bison/deploys/67c59acbedcc8a00081aeab5
😎 Deploy Preview https://deploy-preview-684--nonebot-bison.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Jan 26, 2025

Codecov Report

Attention: Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.

Project coverage is 84.97%. Comparing base (9f16633) to head (4921621).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
nonebot_bison/scheduler/scheduler.py 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #684      +/-   ##
==========================================
- Coverage   85.00%   84.97%   -0.03%     
==========================================
  Files          97       97              
  Lines        5520     5532      +12     
==========================================
+ Hits         4692     4701       +9     
- Misses        828      831       +3     
Flag Coverage Δ
smoke-test 84.97% <81.81%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@felinae98 felinae98 force-pushed the feat/set-interval branch from 2791f30 to 4921621 Compare March 3, 2025 12:04
@suyiiyii suyiiyii requested a review from Copilot March 29, 2025 12:06
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces the ability to adjust scheduling intervals via environment variables.

  • Loads the site-specific scheduling rule from configuration in scheduler.py
  • Adds a new ScheduleConfig model and bison_site_schedule configuration in plugin_config.py
  • Updates the documentation to illustrate how to configure scheduling via environment variables

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
nonebot_bison/scheduler/scheduler.py Added a new helper method to load schedule rules from plugin_config and updated the scheduler initialization
nonebot_bison/plugin_config.py Introduced ScheduleConfig and bison_site_schedule as configurable options
docs/usage/README.md Added usage instructions and examples for the BISON_SITE_SCHEDULE environment variable

@@ -63,6 +71,11 @@ def __init__(
**self.scheduler_config.schedule_setting,
)

def _load_scehdule_rule_from_config(self):
Copy link
Preview

Copilot AI Mar 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method name '_load_scehdule_rule_from_config' contains a spelling error. Consider renaming it to '_load_schedule_rule_from_config' for clarity.

Suggested change
def _load_scehdule_rule_from_config(self):
def _load_schedule_rule_from_config(self):

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant