Changeset 6857


Ignore:
Timestamp:
Feb 16, 2018, 3:05:45 PM (19 months ago)
Author:
mabarracus
Message:

Fix bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lliurex-analytics-server/trunk/fuentes/lliurex-analytics-server/usr/sbin/analyticsd

    r6819 r6857  
    106106    t=str(int(time.time()))
    107107    if DEBUG:
    108         printea('on {} analyticsd({}) is alive, all good :-)'.format(t,who),'debug')
     108        pass
     109        # too much verbose
     110        # printea('on {} analyticsd({}) is alive, all good :-)'.format(t,who),'debug')
    109111    else:
    110112        if who == 'main':
     
    505507            while (lapps['timestamp'] > self.mon.commited):
    506508                time.sleep(0.001)
    507         if len(lapps['apps']) != 0 and len(lapps['clients']) != 0:
     509        if len(lapps['clients']) != 0:
     510            printea('Thread {} putting client'.format(self.t),'debug')
    508511            #IF FAIL, AFTER RETRIES THREAD DIES
    509512            if not self.put_client(client_list=lapps['clients'],mon=self.mon):
    510513                self.q.put(lapps,True) # USELESS
    511514                return False    # USELESS
     515        if len(lapps['apps']) != 0:
     516            printea('Thread {} putting clientapps'.format(self.t),'debug')
    512517            if not (self.put_apps(apps=lapps['apps'],mon=self.mon)):
    513518                self.q.put(lapps,True) # USELESS
     
    522527    def process(self,*args,**kwargs):
    523528        keepalive(self.t)
    524         # code only for main thread
    525         printea("Running thread {}".format(self.t),'debug')
     529        # warning too much verbose, printea("Running thread {}".format(self.t),'debug')
    526530        if self.t == 'main' and not self.mon.terminate:
    527531            ret=self.process_main_thread(*args,**kwargs)
     
    552556                if self.mon.paused:
    553557                    printea("Paused by high load {}".format(self.t),'debug')
    554                 if self.empty:
    555                     printea("Empty queue {} sleeping by now".format(self.t),'debug')
     558                # Too much verbose
     559                #if self.empty:
     560                #    printea("Empty queue {} sleeping by now".format(self.t),'debug')
    556561                if self.empty:
    557562                    self.empty = False
     
    587592                    #    printea("Worker ({}) detected server gone away !!!: {}".format(self.t,e))
    588593
    589                     printea("Trying to recover connection ({})".format(self.t))
     594                    printea("Trying to recover connection ({}), {}".format(self.t,e))
    590595                    if self.reconnect == 100:
    591596                        printea("Worker ({}) says: lost connection to database, reconnection not possible, terminating all processes".format(self.t))
Note: See TracChangeset for help on using the changeset viewer.