Browse Source

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

tags/3.2.3
Mike Khiretskiy 6 years ago
parent
commit
ec254483f3
1 changed files with 8 additions and 9 deletions
  1. +8
    -9
      pym/update/update.py

+ 8
- 9
pym/update/update.py View File

@@ -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):
"""


Loading…
Cancel
Save