feat(chalice): debugging jobs execution
(cherry picked from commit 4113ffaa3b)
This commit is contained in:
parent
4d37578137
commit
84fb33e266
2 changed files with 3 additions and 6 deletions
|
|
@ -111,19 +111,13 @@ def get_scheduled_jobs():
|
|||
WHERE status = %(status)s
|
||||
AND start_at <= (now() at time zone 'utc');""",
|
||||
{"status": JobStatus.SCHEDULED})
|
||||
print(query)
|
||||
cur.execute(query=query)
|
||||
data = cur.fetchall()
|
||||
print(">>>")
|
||||
print(data)
|
||||
return helper.list_to_camel_case(data)
|
||||
|
||||
|
||||
def execute_jobs():
|
||||
print(">>> looking for jobs to execute")
|
||||
jobs = get_scheduled_jobs()
|
||||
print(jobs)
|
||||
|
||||
for job in jobs:
|
||||
print(f"Executing jobId:{job['jobId']}")
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -110,11 +110,14 @@ def rename(source_bucket, source_key, target_bucket, target_key):
|
|||
|
||||
|
||||
def schedule_for_deletion(bucket, key):
|
||||
if not exists(bucket, key):
|
||||
return False
|
||||
s3 = __get_s3_resource()
|
||||
s3_object = s3.Object(bucket, key)
|
||||
s3_object.copy_from(CopySource={'Bucket': bucket, 'Key': key},
|
||||
Expires=datetime.now() + timedelta(days=7),
|
||||
MetadataDirective='REPLACE')
|
||||
return True
|
||||
|
||||
|
||||
def generate_file_key(project_id, key):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue