small cleanups
This commit is contained in:
parent
2a3943df33
commit
792eabc3b8
2 changed files with 9 additions and 5 deletions
|
|
@ -116,7 +116,9 @@ class Job:
|
||||||
logger.debug(e)
|
logger.debug(e)
|
||||||
|
|
||||||
self.last_execution.set_execution_end()
|
self.last_execution.set_execution_end()
|
||||||
|
|
||||||
self.handle_threshold(self.service.get_threshold(), self.last_execution.was_successful())
|
self.handle_threshold(self.service.get_threshold(), self.last_execution.was_successful())
|
||||||
|
|
||||||
logger.info("Job " + self.get_job_id() +
|
logger.info("Job " + self.get_job_id() +
|
||||||
", Code: " + str(self.last_execution.get_error_code()) +
|
", Code: " + str(self.last_execution.get_error_code()) +
|
||||||
", Message: " + str(self.last_execution.get_message()))
|
", Message: " + str(self.last_execution.get_message()))
|
||||||
|
|
|
||||||
|
|
@ -50,12 +50,14 @@ class MongodbTask(Task):
|
||||||
if "port" in args:
|
if "port" in args:
|
||||||
self.port = args["port"]
|
self.port = args["port"]
|
||||||
|
|
||||||
self.mongo_client = MongoClient(self.host, self.port)
|
#self.mongo_client = MongoClient(self.host, self.port)
|
||||||
self.mongo_db = self.mongo_client[self.database]
|
#self.mongo_db = self.mongo_client[self.database]
|
||||||
self.mongo_db_collection = self.mongo_db[self.collection]
|
#self.mongo_db_collection = self.mongo_db[self.collection]
|
||||||
|
|
||||||
def execute(self, job_information):
|
def execute(self, job_information):
|
||||||
self.mongo_db_collection.insert(job_information.__dict__)
|
#self.mongo_db_collection.insert(job_information.__dict__)
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def create(kwargs):
|
def create(kwargs):
|
||||||
return MongodbTask(**kwargs)
|
return MongodbTask(**kwargs)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue