Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

feat: configurable minimum scan age #17

Merged
merged 2 commits into from
Jul 29, 2020
Merged

feat: configurable minimum scan age #17

merged 2 commits into from
Jul 29, 2020

Conversation

m-rots
Copy link
Collaborator

@m-rots m-rots commented Jul 28, 2020

Instead of defaulting to 5 minutes, this PR allows the user to set a custom minimum scan age manually.
The default is still set at 5 minutes.

Config

The config now features a minimum-age field which should be given a string in the following format:

  • 1s if the min-age should be set at 1 second.
  • 5m if the min-age should be set at 5 minutes.
  • 1m30s if the min-age should be set at 1 minute and 30 seconds.
  • 1h if the min-age should be set at 1 hour.
# 1 minute (60 seconds)
minimum-age: 60s

# 5 minutes
minimum-age: 5m

# 30 minutes (0.5 hours)
# commas are not supported!
minimum-age: 0.5h

ns, us and ms are supported as well, but should not be used by nor communicated to the user.
Values such as days, months and years are not supported.

When a number is given instead, it defaults to nanoseconds, the smallest time unit.

Processor

The processor now accepts MinimumAge within its config as time.Duration
This minimum age is used within the datastore's GetMatching(minAge time.Duration) function.

All datastore tests have been updated accordingly

Logging

A new INFO log is printed at the very start which prints the processor's configuration:

  • anchors
  • max_retries
  • min_age

Small changes

I've also updated the CMD logs to display lidarr in the initialised triggers.

@m-rots m-rots added processor Specifically targets the processor module feature A new feature! :D labels Jul 28, 2020
@m-rots m-rots added this to the Early Access Preview milestone Jul 28, 2020
@m-rots m-rots requested a review from l3uddz July 28, 2020 22:11
@m-rots m-rots self-assigned this Jul 28, 2020
@m-rots m-rots merged commit d21675f into master Jul 29, 2020
@m-rots m-rots deleted the retry-time branch July 29, 2020 08:16
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
feature A new feature! :D processor Specifically targets the processor module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants