- Timestamp:
- Feb 7, 2018, 11:35:09 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lliurex-statistics/trunk/fuentes/lliurex-statistics.install/usr/sbin/analytics
r4866 r6776 278 278 f.close(); 279 279 280 global filename,url,proxy,headers ;280 global filename,url,proxy,headers,SEND_ITEMS; 281 281 282 282 db = sqlite3.connect(filename); 283 283 cur= db.cursor(); 284 284 try: 285 cur.execute('select * from info order by n DESC limit 100;');285 cur.execute('select * from info order by n DESC limit {};'.format(SEND_ITEMS)); 286 286 json_tmp={}; 287 287 # Dumps temporary database building json object to send … … 328 328 # 329 329 def show_list_db(): 330 global filename,daemon_mode,DEBUG_FILE 330 global filename,daemon_mode,DEBUG_FILE,SEND_ITEMS 331 331 db = sqlite3.connect(filename) 332 332 cur= db.cursor() 333 333 if daemon_mode != True: 334 print "TOP 10:"334 print "TOP {}:".format(SEND_ITEMS) 335 335 print "~~~~~~~~~~" 336 336 try: 337 cur.execute('select * from info order by n DESC limit 10;')337 cur.execute('select * from info order by n DESC limit {};'.format(SEND_ITEMS)) 338 338 for x in cur.fetchall(): 339 339 print x[0] + " " + str(x[1]); … … 344 344 fp_debug.write("TOP 10:\n~~~~~~~~~~\n") 345 345 try: 346 cur.execute('select * from info order by n DESC limit 10;')346 cur.execute('select * from info order by n DESC limit {};'.format(SEND_ITEMS)) 347 347 for x in cur.fetchall(): 348 348 fp_debug.write(x[0] + " " + str(x[1])+"\n") … … 484 484 TIMEOUT=300 485 485 BDTIMEOUT=300 486 SEND_ITEMS=100 486 487 # Counters for threads going to timeout 487 488 ctimeout=0
Note: See TracChangeset
for help on using the changeset viewer.