""", 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
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
"""
# 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):
"""
"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
<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>