Commit 91140380 authored by Antoine Millet's avatar Antoine Millet
Browse files

[bug#4034] Fixed bug with logging when server fails to start.

parent 6b6bdd0c
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -49,6 +49,10 @@ class CCServer(object):
        # The interface object to the configuration directory:
        self.conf = CCConf(conf_dir)

        # Some settings:
        self._maxcon = maxcon
        self._maxidle = maxidle

        # Create the server socket
        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
@@ -75,13 +79,6 @@ class CCServer(object):
        # The jobs manager:
        self.jobs = JobsManager(self)

        # Register accounts on the database:
        self._update_accounts()

        # Running server internal jobs:
        self.jobs.create('kill_oldcli', maxcon=maxcon, maxidle=maxidle,
                         _hidden=True)

    def _update_accounts(self):
        '''
        Update the database with accounts.
@@ -186,6 +183,13 @@ class CCServer(object):
        Run the server mainloop.
        '''

        # Register accounts on the database:
        self._update_accounts()

        # Running server internal jobs:
        self.jobs.create('kill_oldcli', maxcon=self._maxcon,
                         maxidle=self._maxidle, _hidden=True)

        logging.debug('Running manager mainloop')
        self.manager.run()