Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

rpcserver: fix aquisition of update batch

that part of the code did not take the new request
format into account

Changeset 9231a2675b03

Parent 4426aee7e00d

by Adrian Buehlmann

Changes to one file · Browse files at 9231a2675b03 Showing diff from parent 4426aee7e00d Diff from another changeset...

 
66
67
68
 
69
70
71
72
73
 
 
 
 
 
 
 
 
74
75
 
 
76
77
78
 
92
93
94
95
 
96
97
98
 
66
67
68
69
70
71
 
 
 
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
 
100
101
102
 
103
104
105
106
@@ -66,13 +66,21 @@
  batch.append(r)   print "wait a bit for additional requests..."   time.sleep(0.2) + deferred_requests = []   try:   while True: - r = requests.get_nowait() - print "got update request %s" % r - batch.append(r) + req = requests.get_nowait() + s = req.split('|') + cmd, args = s[0], s[1:] + if cmd == 'update': + print "got update request %s" % r + batch.append(args[0]) + else: + deferred_requests.append(req)   except Queue.Empty:   pass + for req in deferred_requests: + requests.put(req)   msg = "processing batch with %i update requests"   print msg % len(batch)   update_batch(batch) @@ -92,7 +100,7 @@
  if cmd is 'terminate':   logmsg('Updater thread terminating')   return - dispatch(req, cmd, args) + dispatch(req, cmd, args)    Updater().start()