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)
|
||||
|
||||
self.last_execution.set_execution_end()
|
||||
|
||||
self.handle_threshold(self.service.get_threshold(), self.last_execution.was_successful())
|
||||
|
||||
logger.info("Job " + self.get_job_id() +
|
||||
", Code: " + str(self.last_execution.get_error_code()) +
|
||||
", Message: " + str(self.last_execution.get_message()))
|
||||
|
|
@ -213,4 +215,4 @@ class JobInformation(object):
|
|||
return self.response_massage
|
||||
|
||||
def set_response_message(self, msg):
|
||||
self.response_massage = msg
|
||||
self.response_massage = msg
|
||||
|
|
@ -50,12 +50,14 @@ class MongodbTask(Task):
|
|||
if "port" in args:
|
||||
self.port = args["port"]
|
||||
|
||||
self.mongo_client = MongoClient(self.host, self.port)
|
||||
self.mongo_db = self.mongo_client[self.database]
|
||||
self.mongo_db_collection = self.mongo_db[self.collection]
|
||||
#self.mongo_client = MongoClient(self.host, self.port)
|
||||
#self.mongo_db = self.mongo_client[self.database]
|
||||
#self.mongo_db_collection = self.mongo_db[self.collection]
|
||||
|
||||
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):
|
||||
return MongodbTask(**kwargs)
|
||||
Loading…
Add table
Add a link
Reference in a new issue