Mentions légales du service

Skip to content
Snippets Groups Projects
Commit c7826166 authored by Simon Delamare's avatar Simon Delamare
Browse files

db: minor fix in archive duration and api.get_metrics for running jobs

parent ec6ed268
Branches
No related tags found
No related merge requests found
...@@ -294,7 +294,7 @@ END ...@@ -294,7 +294,7 @@ END
$$; $$;
SELECT add_job( SELECT add_job(
'move_chunks_to_archive', '1d', 'move_chunks_to_archive', '1d',
config => '{"hypertable":"metrics_summary", "lag":"14d", "tablespace":"archive"}', config => '{"hypertable":"metrics_summary", "lag":"8d", "tablespace":"archive"}',
initial_start => CURRENT_DATE + TIME '23:59:59' AT TIME ZONE current_setting('TIMEZONE') initial_start => CURRENT_DATE + TIME '23:59:59' AT TIME ZONE current_setting('TIMEZONE')
); );
""" """
...@@ -343,9 +343,8 @@ if job_id: ...@@ -343,9 +343,8 @@ if job_id:
nodetime = plpy.execute("SELECT MIN(start_time) AS start_time, COALESCE(MAX(stop_time), NOW()) AS stop_time, STRING_AGG(node, ',') AS nodes FROM nodetime_by_job WHERE job_id = %s GROUP BY job_id" % job_id)[0] nodetime = plpy.execute("SELECT MIN(start_time) AS start_time, COALESCE(MAX(stop_time), NOW()) AS stop_time, STRING_AGG(node, ',') AS nodes FROM nodetime_by_job WHERE job_id = %s GROUP BY job_id" % job_id)[0]
if not start_time: if not start_time:
start_time = nodetime["start_time"] start_time = nodetime["start_time"]
# TODO Fix for running job
if not end_time: if not end_time:
end_time = nodetime["stop_time"] end_time = nodetime["stop_time"] or "now"
if not _devices: if not _devices:
_devices = nodetime["nodes"] _devices = nodetime["nodes"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment