def set_and_send_nb_job_to_scheduler(self): """Send the number of current compilation job running to the Scheduler""" RemoteJob.nb_job -= 1 ProtocolUtils.connect_send_close(self.__scheduler_address,\ self.__scheduler_port,\ [Protocol.JOB_DONE, "%s"%(RemoteJob.nb_job)])
def clean_on_exit(self): ProtocolUtils.connect_send_close(self.get_config()["scheduler_address"],\ string.atoi(self.get_config()["scheduler_port"]),\ [Protocol.UNSUBSCRIBE_ME]) try: self.__listen_socket.shutdown(0) except socket.error: syslog.syslog(syslog.LOG_ERR | syslog.LOG_DAEMON, \ "Error when shutdown socket with Scheduler") self.__listen_socket.close() for open_socket in CompilerDaemon_mod.open_sockets: open_socket.shutdown(0) self.remove_lock_file()