-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstats.py
47 lines (35 loc) · 1.52 KB
/
stats.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from prefect.deployments import Deployment
from prefect.server.schemas.schedules import CronSchedule
from src.config import settings
from src.flows.stats.meme import calculate_meme_stats
from src.flows.stats.meme_source import calculate_meme_source_stats
from src.flows.stats.user import calculate_user_stats
from src.flows.stats.user_meme_source import calculate_user_meme_source_stats
deployment_user_stats = Deployment.build_from_flow(
flow=calculate_user_stats,
name="Calculate user_stats",
work_pool_name=settings.ENVIRONMENT,
schedule=(CronSchedule(cron="0,15,30,45 * * * *", timezone="Europe/London")),
)
deployment_user_stats.apply()
deployment_user_meme_source_stats = Deployment.build_from_flow(
flow=calculate_user_meme_source_stats,
name="Calculate user_meme_source_stats",
work_pool_name=settings.ENVIRONMENT,
schedule=(CronSchedule(cron="13,28,43,58 * * * *", timezone="Europe/London")),
)
deployment_user_meme_source_stats.apply()
deployment_user_stats = Deployment.build_from_flow(
flow=calculate_meme_stats,
name="Calculate meme_stats",
work_pool_name=settings.ENVIRONMENT,
schedule=(CronSchedule(cron="3,18,33,48 * * * *", timezone="Europe/London")),
)
deployment_user_stats.apply()
deployment_meme_source_stats = Deployment.build_from_flow(
flow=calculate_meme_source_stats,
name="Calculate meme_source_stats",
work_pool_name=settings.ENVIRONMENT,
schedule=(CronSchedule(cron="5,20,35,50 * * * *", timezone="Europe/London")),
)
deployment_meme_source_stats.apply()