Don't use commit() on each SQL insert, it makes things terrislow.
This commit is contained in:
+12
-11
@@ -88,23 +88,24 @@ def main():
|
||||
|
||||
if options.kml is not None:
|
||||
dbname = 'adsb.db'
|
||||
sqldb = air_modes.output_sql(my_position, dbname, context) #input into the db
|
||||
#kmlgen = air_modes.output_kml(options.kml, dbname, my_position, lock) #create a KML generating thread to read from the db
|
||||
lock = threading.Lock()
|
||||
sqldb = air_modes.output_sql(my_position, dbname, lock) #input into the db
|
||||
kmlgen = air_modes.output_kml(options.kml, dbname, my_position, lock) #create a KML generating thread to read from the db
|
||||
relay.subscribe("dl_data", sqldb.insert)
|
||||
|
||||
printer = None
|
||||
if options.no_print is not True:
|
||||
relay.subscribe("dl_data", air_modes.output_print(my_position).output)
|
||||
#printer = screen_printer(my_position, context)
|
||||
|
||||
# if options.multiplayer is not None:
|
||||
# [fghost, fgport] = options.multiplayer.split(':')
|
||||
# fgout = air_modes.output_flightgear(my_position, fghost, int(fgport))
|
||||
# tb.subscribe('dl_data', fgout.output)
|
||||
if options.multiplayer is not None:
|
||||
[fghost, fgport] = options.multiplayer.split(':')
|
||||
fgout = air_modes.output_flightgear(my_position, fghost, int(fgport))
|
||||
relay.subscribe("dl_data", fgout.output)
|
||||
|
||||
# if options.sbs1 is True:
|
||||
# sbs1port = air_modes.output_sbs1(my_position, 30003)
|
||||
# tb.subscribe('dl_data', sbs1port.output)
|
||||
#updates.append(sbs1port.add_pending_conns)
|
||||
# relay.subscribe("dl_data", sbs1port.output)
|
||||
#updates.append(sbs1port.add_pending_conns) #TODO FIXME
|
||||
tb.run()
|
||||
tb.cleanup()
|
||||
|
||||
@@ -112,8 +113,8 @@ def main():
|
||||
relay.finished.wait(0.2)
|
||||
|
||||
if options.kml is not None:
|
||||
sqldb.done = True
|
||||
#sqldb.join()
|
||||
kmlgen.close()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user