]> git.ipfire.org Git - pbs.git/commitdiff
sources: Rename importing any new commits as "fetch" again
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 22 May 2023 19:36:29 +0000 (19:36 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 22 May 2023 19:36:29 +0000 (19:36 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/buildservice/sources.py
src/scripts/pakfire-build-service
src/templates/sources/show.html

index 5617853ac6e77dcd9ef8f203dc10371f5a207c55..089e9ad171b445a92917d570d39d4f261382a9cb 100644 (file)
@@ -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):
                """
index 7a4b094264e5c47d8cfdc4b2b70b06421ff7d989..883421b8fd4dab5f4652924671b0a56289915c5d 100644 (file)
@@ -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
index 31b9b564053a184363e6ccf20dca461f461e9bee..e5dc00b5369e40c8b13bfdc994571a0535636c76 100644 (file)
@@ -51,7 +51,7 @@
                                                <div>
                                                        <p class="heading">{{ _("Last Check") }}</p>
                                                        <p>
-                                                               {{ locale.format_date(source.last_check_at, shorter=True) }}
+                                                               {{ locale.format_date(source.last_fetched_at, shorter=True) }}
                                                        </p>
                                                </div>
                                        </div>