From: Michael Tremer Date: Mon, 22 May 2023 19:36:29 +0000 (+0000) Subject: sources: Rename importing any new commits as "fetch" again X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29bab6ef1665429584196bd14860b30ceca10b16;p=pbs.git sources: Rename importing any new commits as "fetch" again Signed-off-by: Michael Tremer --- diff --git a/src/buildservice/sources.py b/src/buildservice/sources.py index 5617853a..089e9ad1 100644 --- a/src/buildservice/sources.py +++ b/src/buildservice/sources.py @@ -128,11 +128,16 @@ class Sources(base.Object): """, id, ) - # Check + # Fetch - async def check(self): - for source in self: - await source.check() + async def fetch(self): + """ + Fetches any new commits from all sources + """ + # Fetch all sources concurrently + async with asyncio.TaskGroup() as tg: + for source in self: + tg.create_task(source.fetch()) # Process @@ -358,15 +363,13 @@ class Source(base.DataObject): return commit - # Check + # Fetch @property - def last_check_at(self): - return self.data.last_check_at - - # Operations + def last_fetched_at(self): + return self.data.last_fetched_at - async def check(self): + async def fetch(self): """ Fetches any new commits from this source """ @@ -389,8 +392,8 @@ class Source(base.DataObject): # Store the updated revision self._set_attribute("revision", revision) - # Store when we checked - self._set_attribute_now("last_check_at") + # Store when we fetched + self._set_attribute_now("last_fetched_at") async def process(self): """ diff --git a/src/scripts/pakfire-build-service b/src/scripts/pakfire-build-service index 7a4b0942..883421b8 100644 --- a/src/scripts/pakfire-build-service +++ b/src/scripts/pakfire-build-service @@ -49,7 +49,7 @@ class Cli(object): "repos:write" : self.backend.repos.write, # Sources - "sources:check" : self.backend.sources.check, + "sources:fetch" : self.backend.sources.fetch, "sources:process" : self.backend.sources.process, # Sync diff --git a/src/templates/sources/show.html b/src/templates/sources/show.html index 31b9b564..e5dc00b5 100644 --- a/src/templates/sources/show.html +++ b/src/templates/sources/show.html @@ -51,7 +51,7 @@

{{ _("Last Check") }}

- {{ locale.format_date(source.last_check_at, shorter=True) }} + {{ locale.format_date(source.last_fetched_at, shorter=True) }}