2020-03-28 17:22:46 +00:00
|
|
|
from module.campaign.run import CampaignRun
|
|
|
|
|
|
|
|
|
|
|
|
RECORD_SINCE = (0,)
|
2020-06-03 16:49:58 +00:00
|
|
|
CAMPAIGN_NAME = ['c1', 'c2', 'c3']
|
2020-05-31 07:48:22 +00:00
|
|
|
# CAMPAIGN_ALL = ['a1', 'a2', 'a3', 'b1', 'b2', 'b3', 'c1', 'c2', 'c3', 'd1', 'd2', 'd3'] # Trying implement all event maps
|
|
|
|
|
2020-03-28 17:22:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
class CampaignAB(CampaignRun):
|
2020-03-30 04:27:18 +00:00
|
|
|
def run(self, name, folder='campaign_main', total=0):
|
2020-03-28 17:22:46 +00:00
|
|
|
name = name.lower()
|
|
|
|
option = ('EventABRecord', name)
|
|
|
|
if not self.config.record_executed_since(option=option, since=RECORD_SINCE):
|
2020-03-30 04:27:18 +00:00
|
|
|
super().run(name=name, folder=folder, total=1)
|
2020-03-28 17:22:46 +00:00
|
|
|
self.config.record_save(option=option)
|
|
|
|
|
|
|
|
def run_event_daily(self):
|
|
|
|
for name in CAMPAIGN_NAME:
|
|
|
|
self.run(name=name, folder=self.config.EVENT_NAME_AB)
|