Маркер времени запуска проверки на обновление перемещен в ini.env

master3.3
Mike Khiretskiy il y a 10 ans
Parent 236f78176b
révision ec254483f3

@ -178,7 +178,7 @@ class Update:
if not status:
self.printWARNING(_("Updates autocheck is not enabled"))
return False
line = EmergeLog(EmergeLogNamedTask("schedule")).get_last_time()
last_check = SystemIni().getVar('update', 'last_check') or ""
re_interval = re.compile("^(\d+)\s*(hours?|days?|weeks?)?", re.I)
interval_match = re_interval.search(interval)
MINUTE = 60
@ -194,10 +194,9 @@ class Update:
est = int(interval_match.group(1)) * k
else:
est = 3 * HOUR
if line:
linetime = line.partition(":")[0]
if linetime.isdigit():
if (time.time() - int(linetime)) < (est - 10 * MINUTE):
if last_check:
if last_check.isdigit():
if (time.time() - int(last_check)) < (est - 10 * MINUTE):
self.printWARNING(_("Please wait for the update time"))
return False
self.mark_schedule()
@ -691,10 +690,10 @@ class Update:
elog.mark_end_task(),
def mark_schedule(self):
from calculate.update.utils.cl_update import ClUpdateAction
elog = EmergeLog(
EmergeLogNamedTask(ClUpdateAction.log_names['schedule']))
elog.mark_end_task(),
"""
Установить отметку о запуске запланированной проверки
"""
SystemIni().setVar('update', {'last_check': str(int(time.time()))})
def premerge(self, param, *packages):
"""

Chargement…
Annuler
Enregistrer