1
0
This commit is contained in:
2025-12-16 21:28:53 +08:00
parent 59c243b578
commit 61c4cb61ee
37 changed files with 428 additions and 207 deletions

View File

@@ -41,8 +41,12 @@ class SM2Algorithm(BaseAlgorithm):
Args:
quality (int): 记忆保留率量化参数
"""
logger.debug("SM2.revisor 开始feedback: %d, is_new_activation: %s", feedback, is_new_activation)
logger.debug(
"SM2.revisor 开始feedback: %d, is_new_activation: %s",
feedback,
is_new_activation,
)
if feedback == -1:
logger.debug("feedback 为 -1跳过更新")
return
@@ -81,24 +85,32 @@ class SM2Algorithm(BaseAlgorithm):
algodata[cls.algo_name]["interval"] = round(
algodata[cls.algo_name]["interval"] * algodata[cls.algo_name]["efactor"]
)
logger.debug("rept>1计算 interval: %d", algodata[cls.algo_name]["interval"])
logger.debug(
"rept>1计算 interval: %d", algodata[cls.algo_name]["interval"]
)
algodata[cls.algo_name]["last_date"] = timer.get_daystamp()
algodata[cls.algo_name]["next_date"] = (
timer.get_daystamp() + algodata[cls.algo_name]["interval"]
)
algodata[cls.algo_name]["last_modify"] = timer.get_timestamp()
logger.debug("更新日期: last_date=%d, next_date=%d, last_modify=%f",
algodata[cls.algo_name]["last_date"],
algodata[cls.algo_name]["next_date"],
algodata[cls.algo_name]["last_modify"])
logger.debug(
"更新日期: last_date=%d, next_date=%d, last_modify=%f",
algodata[cls.algo_name]["last_date"],
algodata[cls.algo_name]["next_date"],
algodata[cls.algo_name]["last_modify"],
)
@classmethod
def is_due(cls, algodata):
result = algodata[cls.algo_name]["next_date"] <= timer.get_daystamp()
logger.debug("SM2.is_due: next_date=%d, current_daystamp=%d, result=%s",
algodata[cls.algo_name]["next_date"], timer.get_daystamp(), result)
logger.debug(
"SM2.is_due: next_date=%d, current_daystamp=%d, result=%s",
algodata[cls.algo_name]["next_date"],
timer.get_daystamp(),
result,
)
return result
@classmethod