summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/prserv/serv.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/prserv/serv.py')
-rw-r--r--bitbake/lib/prserv/serv.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/bitbake/lib/prserv/serv.py b/bitbake/lib/prserv/serv.py
index 1b08d59130..6ab10972e7 100644
--- a/bitbake/lib/prserv/serv.py
+++ b/bitbake/lib/prserv/serv.py
@@ -122,6 +122,10 @@ class PRServer(SimpleXMLRPCServer):
122 def work_forever(self,): 122 def work_forever(self,):
123 self.quit = False 123 self.quit = False
124 self.timeout = 0.5 124 self.timeout = 0.5
125 iter_count = 1
126 # With 60 iterations between syncs and a 0.5 second timeout between
127 # iterations, this will sync if dirty every ~30 seconds.
128 iterations_between_sync = 60
125 129
126 logger.info("Started PRServer with DBfile: %s, IP: %s, PORT: %s, PID: %s" % 130 logger.info("Started PRServer with DBfile: %s, IP: %s, PORT: %s, PID: %s" %
127 (self.dbfile, self.host, self.port, str(os.getpid()))) 131 (self.dbfile, self.host, self.port, str(os.getpid())))
@@ -129,6 +133,9 @@ class PRServer(SimpleXMLRPCServer):
129 self.handlerthread.start() 133 self.handlerthread.start()
130 while not self.quit: 134 while not self.quit:
131 self.handle_request() 135 self.handle_request()
136 iter_count = (iter_count + 1) % iterations_between_sync
137 if iter_count == 0:
138 self.table.sync_if_dirty()
132 139
133 self.table.sync() 140 self.table.sync()
134 logger.info("PRServer: stopping...") 141 logger.info("PRServer: stopping...")