Skip to content

Commit

Permalink
Merge pull request #230 from jpwhite4/jobscript
Browse files Browse the repository at this point in the history
Fix jobscript ingestion sql.
  • Loading branch information
jpwhite4 committed Oct 9, 2020
2 parents 158d5fe + 7cb4429 commit 4a2d606
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/supremm/ingest_jobscripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ def __init__(self, dwconfig, schema, timestamp_mode):
`modw`.`job_tasks`
WHERE
resource_id = %s
AND local_job_id_raw = %s
ON DUPLICATE KEY UPDATE script = script"""
AND local_job_id_raw = %s"""

if self.timestamp_mode == 'start':
self.query += ' AND ABS(DATEDIFF(DATE(FROM_UNIXTIME(start_time_ts)), %s)) < 2'
Expand All @@ -59,6 +58,8 @@ def __init__(self, dwconfig, schema, timestamp_mode):
#else
# self.timestamp_mode == 'None' which means no date restrictions

self.query += " ON DUPLICATE KEY UPDATE resource_id = VALUES(resource_id), start_date = VALUES(start_date), script = VALUES(script)"

self.buffered = 0

def insert(self, data):
Expand Down

0 comments on commit 4a2d606

Please sign in to comment.