-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(api): Fix metrics lifecycle policies tasks (#29)
* chore(api): Add endpoint for triggering MLP / Run MLP every 2 hours * chore(api): Bump app version #patch --------- Signed-off-by: hayk96 <hayko5999@gmail.com>
- Loading branch information
Showing
12 changed files
with
138 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.venv/ | ||
.idea/ | ||
tests/ | ||
docs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
from apscheduler.schedulers.background import BackgroundScheduler | ||
from apscheduler.triggers.interval import IntervalTrigger | ||
from src.tasks.policies import task_run_policies | ||
from src.tasks.policies import run_policies | ||
import atexit | ||
|
||
|
||
def schedule(): | ||
def schedule(trigger=IntervalTrigger(hours=2)): | ||
scheduler = BackgroundScheduler() | ||
scheduler.start() | ||
scheduler.add_job( | ||
func=task_run_policies, | ||
trigger=IntervalTrigger(minutes=20), | ||
name='Schedule task "cleanup time-series" every 20 minutes', | ||
replace_existing=True | ||
func=run_policies, | ||
trigger=trigger, | ||
replace_existing=True, | ||
name="Clean-up Prometheus time-series" | ||
) | ||
atexit.register(lambda: scheduler.shutdown()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters