How to use add_job method in localstack

Best Python code snippet using localstack_python

time_start2.py

Source:time_start2.py Github

copy

Full Screen

...130 # 是否是公司 产品131 t_ape = "1"132 # cur_batch1 = ""133 batch11 = cur_batch()134 # scheduler.add_job(get_bs_asin_elf,)135 # scheduler.add_job(get_bs_asin_elf1, 'interval', minutes=4)136 # scheduler.add_job(get_bs_asin_elf2, 'interval', minutes=5)137 # scheduler.add_job(get_bs_asin_elf3, 'interval', minutes=6)138 type_obj = {139 'amazon.com': 'amazon_com',140 'amazon.ca': 'amazon_ca',141 'amazon.co.jp': 'amazon_jp',142 'amazon.co.uk': 'amazon_uk',143 'amazon.es': 'amazon_es',144 'amazon.de': 'amazon_de',145 'amazon.fr': 'amazon_fr',146 'amazon.it': 'amazon_it',147 'amazon.com.au': 'amazon_au',148 }149 #150 # for k ,v in type_obj.items():151 # scheduler.add_job(get_bs_asin_elf1, 'interval', minutes=8,args=[k])152 # scheduler.add_job(get_bs_asin_elf2, 'interval', minutes=9,args=[k])153 # scheduler.add_job(get_bs_asin_elf3, 'interval', minutes=10,args=[k])154 scheduler.add_job(tick, 'interval', minutes=10)155 # scheduler.add_job(tick1, 'interval', minutes=10)156 # scheduler.add_job(tick2, 'interval', minutes=30)157 # scheduler.add_job(tick3, 'interval', minutes=30)158 # scheduler.add_job(tick4, 'interval', minutes=30)159 # scheduler.add_job(tick5, 'interval', minutes=30)160 # scheduler.add_job(tick6, 'interval', minutes=30)161 # scheduler.add_job(tick7, 'interval', minutes=30)162 ############163 scheduler.add_job(tick8, 'interval', minutes=30)164 scheduler.add_job(tick9, 'interval', minutes=30)165 scheduler.add_job(tick10, 'interval', minutes=30)166 scheduler.add_job(tick11, 'interval', minutes=30)167 scheduler.add_job(tick12, 'interval', minutes=30)168 scheduler.add_job(tick13, 'interval', minutes=30)169 scheduler.add_job(tick14, 'interval', minutes=30)170 # scheduler.add_job(get_bs_asin_elf1, 'interval', minutes=4, args=['amazon.com'])171 # scheduler.add_job(get_bs_asin_elf2, 'interval', minutes=5, args=['amazon.com'])172 # scheduler.add_job(get_bs_asin_elf3, 'interval', minutes=6, args=['amazon.com'])173 #174 # scheduler.add_job(get_bs_asin_elf1, 'interval', minutes=4, args=['amazon.ca'])175 # scheduler.add_job(get_bs_asin_elf2, 'interval', minutes=5, args=['amazon.ca'])176 # scheduler.add_job(get_bs_asin_elf3, 'interval', minutes=6, args=['amazon.ca'])177 # scheduler.add_job(get_bs_asin_elf3, 'interval', minutes=2)178 # scheduler.add_job(tick, 'interval', seconds=5,misfire_grace_time=3600,max_instances=10)179 # print(a)180 # scheduler.add_job(tick, 'interval', minutes=2)181 # scheduler.add_job(tick, 'interval', days=1, start_date="2021-2-19 5:00:00")182 # scheduler.add_job(tick, 'cron' ,hour=11,minute=44)183 # scheduler.add_job(tick,'cron', hour='12-23', minute='00', second='00')184 # scheduler.add_job(tick,'cron', hour='0-6', minute='00', second='00')185 scheduler.start()186 # print("Press Ctrl + {0} to exit".format('Break' if os.name == 'nt' else 'C'))187 try:188 while True:189 time.sleep(5)190 print(f"sleep! - {datetime.now()}")191 except (KeyboardInterrupt, SystemExit):192 scheduler.shutdown()...

Full Screen

Full Screen

aps_config.py

Source:aps_config.py Github

copy

Full Screen

...25 else:26 test_init()27def test_init():28 """测试环境"""29 scheduler.add_job(get_603_data.get_center_data, id='get_center_data', trigger='interval', minutes=6)30 scheduler.add_job(get_603_data.get_chanct_data, id='get_chanct_data',trigger='interval', minutes=3)31 scheduler.add_job(get_603_data.get_match_data, id='get_match_data', trigger='interval', minutes=4)32 scheduler.add_job(get_603_data.get_sms_sjjs_data, id='get_sms_sjjs_data', trigger='interval', minutes=5)33 scheduler.add_job(get_603_data.get_sms_load_data, id='get_sms_load_data', trigger='interval', minutes=5)34 scheduler.add_job(get_603_data.get_mms_sjjs_data, id='get_mms_sjjs_data', trigger='interval', minutes=5)35 scheduler.add_job(get_603_data.get_mms_load_data, id='get_mms_load_data', trigger='interval', minutes=5)36 scheduler.add_job(get_603_data.get_relate_rate_data, id='get_relate_rate_data', trigger='interval', minutes=7)37 scheduler.add_job(get_509_data.get_loading_rate_data, args=['10.41.18.69'] , id='get_loading_rate_data', trigger='interval', minutes=2)38 scheduler.add_job(get_509_data.get_hive_db_data, args=['10.41.18.69'], id='get_hive_db_data', trigger='interval', minutes=8)39 scheduler.add_job(get_509_data.get_hive_db_increment, id='get_hive_db_increment', trigger='interval', minutes=6)40 scheduler.add_job(get_509_data.get_loading_rate_increment, id='get_loading_rate_increment', trigger='interval', minutes=8)41 scheduler.add_job(get_509_data.get_row_flow, id='get_row_flow', trigger='interval', minutes=8)42 scheduler.add_job(get_ipsy_data.get_log_data, id='get_log_data', trigger='interval', minutes=10)43 scheduler.add_job(get_ipsy_data.get_history_log_data, id='get_history_log_data', trigger='date', run_date=now_datetime, args=['2021-01-01', '2021-03-01', '/opt/rzx_ipsy_data'])44 scheduler.add_job(get_ipsy_data.get_log_increment, id='get_log_increment', trigger='interval', minutes=8)45 scheduler.add_job(get_ipsy_data.get_disk_usage, id='get_disk_usage', trigger='interval', minutes=5)46 scheduler.add_job(get_ipsy_data.get_bc_data, id='get_bc_data', trigger='interval', minutes=5)47 scheduler.add_job(get_public_data.get_topo_ip, id='get_topo_ip', trigger='interval', minutes=1)48 scheduler.add_job(get_public_data.get_topo_ip_list, id='get_topo_ip_list', trigger='interval', hours=24)49def product_init():50 """生产环境"""51 # 每小时(上下浮动120秒区间内)运行'get_center_data' jitter振动参数,给每次触发添加一个随机浮动秒数,避免同时运行造成服务拥堵52 scheduler.add_job(get_603_data.get_center_data, id='get_center_data', trigger='interval', hours=1, jitter=120)53 scheduler.add_job(get_603_data.get_chanct_data, id='get_chanct_data',trigger='interval', minutes=10)54 scheduler.add_job(get_603_data.get_match_data, id='get_match_data', trigger='interval', minutes=15)55 scheduler.add_job(get_603_data.get_sms_sjjs_data, id='get_sms_sjjs_data', trigger='interval', minutes=5)56 scheduler.add_job(get_603_data.get_sms_load_data, id='get_sms_load_data', trigger='interval', minutes=5)57 scheduler.add_job(get_603_data.get_mms_sjjs_data, id='get_mms_sjjs_data', trigger='interval', minutes=5)58 scheduler.add_job(get_603_data.get_mms_load_data, id='get_mms_load_data', trigger='interval', minutes=5)59 scheduler.add_job(get_603_data.get_relate_rate_data, id='get_relate_rate_data', trigger='interval', minutes=10)60 scheduler.add_job(get_509_data.get_loading_rate_data, args=['10.41.18.69'] , id='get_loading_rate_data', trigger='interval', minutes=2)61 scheduler.add_job(get_509_data.get_hive_db_data, args=['10.41.18.69'], id='get_hive_db_data', trigger='interval', minutes=10)62 scheduler.add_job(get_509_data.get_hive_db_increment, id='get_hive_db_increment', trigger='interval', minutes=60)63 scheduler.add_job(get_509_data.get_loading_rate_increment, id='get_loading_rate_increment', trigger='interval', minutes=5)64 scheduler.add_job(get_509_data.get_row_flow, id='get_row_flow', trigger='interval', minutes=8)65 scheduler.add_job(get_ipsy_data.get_log_data, id='get_log_data', trigger='interval', hours=24)66 scheduler.add_job(get_ipsy_data.get_history_log_data, id='get_history_log_data', trigger='date', run_date=now_datetime, args=['2021-01-01', '2021-03-01', '/opt/rzx_ipsy_data'])67 scheduler.add_job(get_ipsy_data.get_log_increment, id='get_log_increment', trigger='interval', hours=24)68 scheduler.add_job(get_ipsy_data.get_disk_usage, id='get_disk_usage', trigger='interval', minutes=60)69 scheduler.add_job(get_ipsy_data.get_bc_data, id='get_bc_data', trigger='cron', month='1-12', day='1', hour=0)70 scheduler.add_job(get_public_data.get_topo_ip, id='get_topo_ip', trigger='interval', minutes=1)...

Full Screen

Full Screen

schedule_program.py

Source:schedule_program.py Github

copy

Full Screen

...12from check_oracle_alive import checkOracleAlive13from guanyuan_data_reflash import guan_card_reflash_dd14### 定时调度任务:监控门店15sched = BlockingScheduler()16#sched.add_job(monitor_peisong, 'interval', seconds=5)17### 门店配送-加货情况监控18# sched.add_job(monitor_peisong, 'cron',hour = '9')19## 总部监控20## 监控 非码订单非当日接入的情况21sched.add_job(job_hderp_stkout_feima,'cron',hour='9')22### 总部 重要提醒23#sched.add_job(send_import_alert,'cron',hour='8,10,12,16,21')24### 总部 帆软报表用户密码更新 删除离职用户25#sched.add_job(update_finereport_userpwd,'cron',hour='*/1')26## 总部 Web服务监控27sched.add_job(WebServiceMonitor().checkService,'cron',hour='5-23', minute ='*/12')28## 总部 日志服务监控 LogServiceMonitor29sched.add_job(LogServiceMonitor().checkLog,'cron',hour='5-23', minute ='*/12')30## 总部 服务器磁盘、DG 服务监控 LogServiceMonitor31#sched.add_job(checkDiskAndDatabaseBak,'cron',hour='9,11,12,14,16,18,21')32## 总部 中控人事同步接口异常监控33#sched.add_job(getZkRsJKInfo,'cron',hour='8,9,10,11,12,13,14,15,16,17,18')34## 总部 在线率监控 合集:中控、JPOS、八乐在线35#sched.add_job(dailyonline_Monitor,'cron',hour='8,10,14,16,18')36## 总部数据库可用性监控37sched.add_job(checkOracleAlive, 'cron', hour='7-22', minute ='*/10')38## 观远卡片更新 督导考勤39sched.add_job(guan_card_reflash_dd, 'cron', hour='7-13', minute='4,34')...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run localstack automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful