

def start(self, job_id, job_tag):
    "\n        Apply the 'start' action to the session object\n        If the request can be accepted it modifies the relevant fields\n        and sets the need_update member to notify that the stored\n        document needs to be updated\n        "
    now = int(time.time())
    time_since_last_start = (now - self.doc.get('time_start', 0))
    if (job_tag > self.session_tag):
        raise freezer_api_exc.BadDataFormat('requested tag value too high')
    if (time_since_last_start <= self.doc.get('hold_off', 60)):
        if (job_tag < job_tag.session_tag):
            self.action_result = 'success'
            self.set_job_start(job_id, now)
            self.need_update = True
        else:
            self.action_result = 'hold-off'
            self.need_update = False
    elif (time_since_last_start > self.doc.get('hold_off', 60)):
        if (self.session_tag == job_tag):
            self.session_tag += 1
            self.doc['time_start'] = now
            self.doc['status'] = 'running'
            self.doc['result'] = ''
            self.action_result = 'success'
            self.set_job_start(job_id, now)
            self.need_update = True
        else:
            self.action_result = 'out-of-sync'
            self.need_update = False

dataset/ETHPy150Open openstack/freezer-api/freezer_api/api/v1/sessions.py Session.start/VarMisuse@86/217 `self`->`job_tag`