Skip to content
Permalink
Browse files
auto: more reliable rebuild queue
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Sep 7, 2018
1 parent e13cce2 commit 60a40a436c75550af3fe471d4cee45e3161984d8
Showing 1 changed file with 2 additions and 5 deletions.
@@ -245,7 +245,7 @@ def _execute(self, options, args):
# Run the event loop forever and handle shutdowns.
try:
# Run rebuild queue
loop.run_until_complete(self.run_rebuild_queue())
queue_future = asyncio.ensure_future(self.run_rebuild_queue())

self.dns_sd = dns_sd(port, (options['ipv6'] or '::' in host))
loop.run_forever()
@@ -255,8 +255,8 @@ def _execute(self, options, args):
self.logger.info("Server is shutting down.")
if self.dns_sd:
self.dns_sd.Reset()
queue_future.cancel()
srv.close()
loop.run_until_complete(self.rebuild_queue.put((None, None)))
loop.run_until_complete(srv.wait_closed())
loop.run_until_complete(webapp.shutdown())
loop.run_until_complete(handler.shutdown(5.0))
@@ -291,9 +291,6 @@ def run_rebuild_queue(self):
"""Run rebuilds from a queue (Nikola can only build in a single instance)."""
while True:
date, event_path = yield from self.rebuild_queue.get()
if date is None:
# Shutdown queue
return
if date < (self.last_rebuild + self.delta_last_rebuild):
self.logger.debug("Skipping rebuild from {0} (within delta)".format(event_path))
continue

0 comments on commit 60a40a4

Please sign in to comment.