Commit 81966dfa authored by Alejandro Alvarez Ayllon's avatar Alejandro Alvarez Ayllon
Browse files

Make sure initial state is SUBMITTED

parent c4fc4c06
......@@ -567,9 +567,9 @@ class JobsController(BaseController):
# Send messages
# Need to re-query so we get the file ids
job = Session.query(Job).get(populated.job_id)
for transfer in job.files:
for i in range(len(job.files)):
try:
submit_state_change(job, transfer)
submit_state_change(job, job.files[i], populated.files[0]['file_state'])
except Exception, e:
log.warning("Failed to write state message to disk: %s" % e.message)
......
......@@ -27,7 +27,7 @@ except:
log = logging.getLogger(__name__)
def submit_state_change(job, transfer):
def submit_state_change(job, transfer, transfer_state):
"""
Writes a state change message to the dirq
"""
......@@ -49,7 +49,7 @@ def submit_state_change(job, transfer):
job_id=job['job_id'],
file_id=transfer['file_id'],
job_state=job['job_state'],
file_state=transfer['file_state'],
file_state=transfer_state,
retry_counter=0,
retry_max=0,
timestamp=time.time()*1000,
......@@ -64,4 +64,4 @@ def submit_state_change(job, transfer):
q = QueueSimple(path=mon_dir)
q.add_path(tmpfile.name)
log.debug("Sent SUBMITTED state for %s %d" % (job['job_id'], transfer['file_id']))
\ No newline at end of file
log.debug("Sent SUBMITTED state for %s %d" % (job['job_id'], transfer['file_id']))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment