Commit 0cc349cf authored by 赵建伟's avatar 赵建伟

update codes

parent 8bd5b419
......@@ -9,8 +9,7 @@ import sys
reload(sys)
sys.setdefaultencoding('utf8')
current_time_str = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
three_days_ago_date_str = (datetime.datetime.now() - datetime.timedelta(days=3)).strftime("%Y-%m-%d")
days_ago_date_str = (datetime.datetime.now() - datetime.timedelta(days=1)).strftime("%Y-%m-%d")
# mysql操作工具类
class MysqlOperator:
......@@ -52,7 +51,7 @@ def ctr_clk_crt_del():
filemode='a',
format='%(asctime)s - %(pathname)s[line:%(lineno)d] - %(levelname)s: %(message)s'
)
ctr_clk_crt_del_sql = "delete from device_current_estimate_clk where partition_date <= '" + three_days_ago_date_str + "'"
ctr_clk_crt_del_sql = "delete from device_current_estimate_clk where partition_date <= '" + days_ago_date_str + "'"
del_or_update(ctr_clk_crt_del_sql)
clk_msg="ctr_clk_crt_del result del success!"
......
......@@ -9,7 +9,7 @@ import sys
reload(sys)
sys.setdefaultencoding('utf8')
current_time_str = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
three_days_ago_date_str = (datetime.datetime.now() - datetime.timedelta(days=3)).strftime("%Y-%m-%d")
days_ago_date_str = (datetime.datetime.now() - datetime.timedelta(days=1)).strftime("%Y-%m-%d")
# mysql操作工具类
......@@ -52,7 +52,7 @@ def ctr_pfr_crt_del():
filemode='a',
format='%(asctime)s - %(pathname)s[line:%(lineno)d] - %(levelname)s: %(message)s'
)
ctr_pfr_crt_del_sql = "delete from device_current_estimate_view_pfr where partition_date <= '" + three_days_ago_date_str + "'"
ctr_pfr_crt_del_sql = "delete from device_current_estimate_view_pfr where partition_date <= '" + days_ago_date_str + "'"
del_or_update(ctr_pfr_crt_del_sql)
clk_msg="ctr_pfr_crt_del result del success!"
......
......@@ -9,8 +9,7 @@ import sys
reload(sys)
sys.setdefaultencoding('utf8')
current_time_str = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
three_days_ago_date_str = (datetime.datetime.now() - datetime.timedelta(days=3)).strftime("%Y-%m-%d")
days_ago_date_str = (datetime.datetime.now() - datetime.timedelta(days=1)).strftime("%Y-%m-%d")
# mysql操作工具类
class MysqlOperator:
......@@ -52,14 +51,8 @@ def surplus_del():
filemode='a',
format='%(asctime)s - %(pathname)s[line:%(lineno)d] - %(levelname)s: %(message)s'
)
del_clk_sql = "delete from device_current_estimate_clk where partition_date <= '" + three_days_ago_date_str + "'"
del_tag_plat_sql = "delete from device_current_estimate_tag_plat where partition_date <= '" + three_days_ago_date_str + "'"
del_tag_unplat_sql = "delete from device_current_estimate_tag_unplat where partition_date <= '" + three_days_ago_date_str + "'"
del_or_update(del_clk_sql)
clk_msg="ctr-estimate-clk surplus result del success!"
print clk_msg
logging.info(clk_msg)
del_tag_plat_sql = "delete from device_current_estimate_tag_plat where partition_date <= '" + days_ago_date_str + "'"
del_tag_unplat_sql = "delete from device_current_estimate_tag_unplat where partition_date <= '" + days_ago_date_str + "'"
del_or_update(del_tag_plat_sql)
tag_plat_msg="ctr-estimate-tag-plat surplus result del success!"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment