示例#1
0
 def enrich_job(self, job_data, job_id):
     running = PydioScheduler.Instance().is_job_running(job_id)
     job_data['running'] = running
     logger = EventLogger(JobsLoader.Instance().build_job_data_path(job_id))
     last_events = logger.get_all(1, 0)
     if len(last_events):
         job_data['last_event'] = last_events.pop()
     if running:
         job_data['state'] = PydioScheduler.Instance().get_job_progress(job_id)
示例#2
0
 def enrich_job(self, job_data, job_id):
     running = PydioScheduler.Instance().is_job_running(job_id)
     job_data['running'] = running
     logger = EventLogger(JobsLoader.Instance().build_job_data_path(job_id))
     last_events = logger.get_all(1, 0)
     if len(last_events):
         job_data['last_event'] = last_events.pop()
     if running:
         job_data['state'] = PydioScheduler.Instance().get_job_progress(
             job_id)
示例#3
0
 def enrich_job(self, job_data, job_id, get_notification=False):
     running = PydioScheduler.Instance().is_job_running(job_id)
     job_data['running'] = running
     logger = EventLogger(JobsLoader.Instance().build_job_data_path(job_id))
     if get_notification:
         notification = logger.consume_notification()
         if notification:
             job_data['notification'] = notification
     last_events = logger.get_all(1, 0)
     if len(last_events):
         job_data['last_event'] = last_events.pop()
     if running:
         job_data['state'] = PydioScheduler.Instance().get_job_progress(job_id)
示例#4
0
    def get(self, job_id):
        if not job_id in JobsLoader.Instance().get_jobs():
            return "Can't find any job config with this ID.", 404

        logger = EventLogger(JobsLoader.Instance().build_job_data_path(job_id))
        if not request.args:
            logs = logger.get_all(20,0)
        else:
            filter = request.args.keys()[0]
            filter_parameter = request.args.get(filter)
            logs = logger.filter(filter, filter_parameter)

        tasks = PydioScheduler.Instance().get_job_progress(job_id)
        return {"logs":logs, "running":tasks}
示例#5
0
    def get(self, job_id):
        if not job_id in JobsLoader.Instance().get_jobs():
            return "Can't find any job config with this ID.", 404

        logger = EventLogger(JobsLoader.Instance().build_job_data_path(job_id))
        if not request.args:
            logs = logger.get_all(20, 0)
        else:
            filter = request.args.keys()[0]
            filter_parameter = request.args.get(filter)
            logs = logger.filter(filter, filter_parameter)

        tasks = PydioScheduler.Instance().get_job_progress(job_id)
        return {"logs": logs, "running": tasks}
示例#6
0
 def enrich_job(self, job_data, job_id, get_notification=False):
     running = PydioScheduler.Instance().is_job_running(job_id)
     job_data['running'] = running
     logger = EventLogger(JobsLoader.Instance().build_job_data_path(job_id))
     if get_notification:
         notification = logger.consume_notification()
         if notification:
             job_data['notification'] = notification
     last_events = logger.get_all(1, 0)
     if len(last_events):
         job_data['last_event'] = last_events.pop()
     if running:
         job_data['state'] = PydioScheduler.Instance().get_job_progress(
             job_id)