Commit 7d1cfbe4 authored by Seblu's avatar Seblu
Browse files

Package.check always return check_delta time

Fix return NoneType in check:
[INFO] imapsync: Next check is planned in 3358s
[CRITICAL] '<' not supported between instances of 'int' and 'NoneType'
Traceback (most recent call last):
  File "/usr/bin/aurbot", line 458, in <module>
    Robot().start()
  File "/usr/bin/aurbot", line 449, in start
    timeout = min(next_checks)
TypeError: '<' not supported between instances of 'int' and 'NoneType'
parent 76228249
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -327,6 +327,7 @@ class Package():
    return check_delta

  def check(self):
    '''Check packages for updates. Return the time in second before next check.'''
    # compute check delta
    check_delta = self.check_delta()
    if check_delta > 0:
@@ -339,7 +340,7 @@ class Package():
      self._local.lastchecked = int(time())
    except Exception as exp:
      self.error(f"Unable to get AUR package info: {exp}")
      return
      return check_delta
    # few debug printing
    self.debug(f"AUR last modified: {self._aur.lastmodified}")
    self.debug(f"Local last success lastmodified: {self._local.lastbuild}")
@@ -351,7 +352,7 @@ class Package():
        self.info("Up to date, but force value is present.")
        if self._config["force"].isdigit() is False:
          self.warn("Invalid force value, ignore it")
          return
          return check_delta
        # if lastbuild not exists, it will be equal to 0
        # too small to be > to time() even with big force time
        now = int(time())