Merge pull request #437 from thsrite/main

This commit is contained in:
jxxghp 2023-09-04 22:22:40 +08:00 committed by GitHub
commit 73e7e547ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1051,11 +1051,6 @@ class SiteStatistic(_PluginBase):
with ThreadPool(min(len(refresh_sites), int(self._queue_cnt or 5))) as p: with ThreadPool(min(len(refresh_sites), int(self._queue_cnt or 5))) as p:
p.map(self.__refresh_site_data, refresh_sites) p.map(self.__refresh_site_data, refresh_sites)
# 获取今天的日期
key = datetime.now().strftime('%Y-%m-%d')
# 保存数据
self.save_data(key, self._sites_data)
# 通知刷新完成 # 通知刷新完成
if self._notify: if self._notify:
yesterday_sites_data = {} yesterday_sites_data = {}
@ -1101,9 +1096,14 @@ class SiteStatistic(_PluginBase):
self.post_message(mtype=NotificationType.SiteMessage, self.post_message(mtype=NotificationType.SiteMessage,
title="站点数据统计", text="\n".join(messages)) title="站点数据统计", text="\n".join(messages))
# 更新时间 # 获取今天的日期
self.save_data("last_update_time", key) key = datetime.now().strftime('%Y-%m-%d')
logger.info("站点数据刷新完成") # 保存数据
self.save_data(key, self._sites_data)
# 更新时间
self.save_data("last_update_time", key)
logger.info("站点数据刷新完成")
def __update_config(self): def __update_config(self):
self.update_config({ self.update_config({