Update exp.py

pull/131/head
StarsL.cn 2024-10-19 16:25:05 +08:00 committed by GitHub
parent 0c5e439c72
commit 33ce6b38f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -74,13 +74,14 @@ class Exp(Resource):
collect_days = exp_config_dict['collect_days']
notify_days = exp_config_dict['notify_days']
notify_amount = exp_config_dict['notify_amount']
notify_interval = exp_config_dict.get('notify_interval',1) * 60
if exp_config_dict['switch']:
for i in cloud_list:
vendor,account = i.split('/')[2:4]
exp_job_id = f'{vendor}/{account}/exp'
exp_job_func = f'__main__:{vendor}.exp'
exp_job_args = [account,collect_days,notify_days,notify_amount]
exp_job_interval = 60
exp_job_interval = notify_interval
addjob(exp_job_id,exp_job_func,exp_job_args,exp_job_interval)
exp_job_dict = {'id':exp_job_id,'func':exp_job_func,'args':exp_job_args,'minutes':exp_job_interval,'trigger': 'interval','replace_existing': True}
consul_kv.put_kv(f'ConsulManager/exp/jobs/{vendor}/{account}',exp_job_dict)