INNER CODE UNIT · Python
serve_forever
opentimestamps/opentimestamps-server · otsserver/backup.py:222
def serve_forever(self):
super().serve_forever()
# This is the thread responsible for asking the chunks to the running calendar and import them in the db.
# The main script allow to launch 1 thread of this for every calendar to backup, thus a backup server could
# theoretically serve timestamp in place of every calendar server which supports this incremental live backup mechanism
class AskBackup(threading.Thread):
def __init__(self, db, calendar_url, base_path, btc_net):
self.db = db
self.calendar_url = calendar_url
calendar_url_parsed = urlparse(calendar_url)
self.up_to_path = os.path.join(base_path, calendar_url_parsed.netloc)
self.btc_net = btc_net
super().__init__(target=self.loop)