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

Add support for individual feed poll timers #122

Merged
merged 1 commit into from
May 21, 2021

Conversation

Qinusty
Copy link
Contributor

@Qinusty Qinusty commented May 20, 2021

This follows on from #85 to introduce separate polling timers for individual feeds.

Feeds are grouped and polled based on their schedules defined in FeedOptions, alternatively a default schedule is applied based upon pollRate in the root of the configuration (which runs if timer is enabled in the configuration).

@Qinusty Qinusty force-pushed the qinusty/per-feed-polling branch 2 times, most recently from 3321806 to f9d596e Compare May 20, 2021 14:53
feeds/README.md Outdated

`packages` this configuration option is only available on certain feeds, check the README of the feed you're interested in for information on this.

`schedule` this allows for polling to be configured on a schedule for this specific feed. This is supported by all feeds. The value for this field should match the format defined by the [cron library](https://pkg.go.dev/github.com/robfig/cron#hdr-CRON_Expression_Format), intervals and predefined schedules are also supported.
Copy link
Contributor

Choose a reason for hiding this comment

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

Having the main option of poll_rate parsed as time.Duration and feed specific schedules as cron formatted strings might be slightly confusing for users. Do we want to be consistent here? poll_rate has the caveat that it's used as an actual duration value too for the cutoff.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmmm... perhaps it's worth restricting this value to be intervals set as time.Duration parsable strings which we can prepend with @every.

I think this is flexible enough for most usecases.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd vote for the prepending where necessary :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

renamed schedule to poll_rate and changed logic to operate identically to poll_rate in the top level configuration.

@Qinusty Qinusty force-pushed the qinusty/per-feed-polling branch 2 times, most recently from 58b41ff to 06a9bf2 Compare May 21, 2021 10:50
@Qinusty Qinusty force-pushed the qinusty/per-feed-polling branch from 06a9bf2 to c1dddc0 Compare May 21, 2021 12:20
@Qinusty Qinusty merged commit 0ffa7e4 into ossf:main May 21, 2021
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