import datetime
from my_config import set_config
from log import Log
from db_helper import RedisHelper

config_, _ = set_config()
log_ = Log()

now_date = datetime.datetime.today()
log_.info(f"now_date: {datetime.datetime.strftime(now_date, '%Y%m%d%H')}")
redis_helper = RedisHelper()
redis_helper.set_data_to_redis(
    key_name=f"{config_.RULE_24H_DATA_STATUS}:{datetime.datetime.strftime(now_date, '%Y%m%d%H')}", value='0', expire_time=2 * 3600
)
redis_helper.set_data_to_redis(
    key_name=f"{config_.REGION_24H_DATA_STATUS}:{datetime.datetime.strftime(now_date, '%Y%m%d%H')}", value='0', expire_time=2 * 3600
)
redis_helper.set_data_to_redis(
    key_name=f"{config_.RULE_H_DATA_STATUS}:{datetime.datetime.strftime(now_date, '%Y%m%d%H')}", value='0', expire_time=2 * 3600
)
redis_helper.set_data_to_redis(
    key_name=f"{config_.REGION_H_DATA_STATUS}:{datetime.datetime.strftime(now_date, '%Y%m%d%H')}", value='0', expire_time=2 * 3600
)
log_.info(f"recommend data status update to initial '0' finished!")
