Debian Codegraph @

tests/flakyfunctional/restart/14-multicycle/bin/ctb-select-task-states

raw
1 #!/usr/bin/env bash
2 # THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.
3 # Copyright (C) NIWA & British Crown (Met Office) & Contributors.
4 #
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #-------------------------------------------------------------------------------
18 set -eu
19 CYLC_WORKFLOW_RUN_DIR="$1"
20 CYLC_TASK_NAME="${2:-}"
21 sqlite3 "${CYLC_WORKFLOW_RUN_DIR}/log/db" "
22 SELECT
23 task_states.name,
24 task_states.cycle,
25 task_states.submit_num,
26 task_jobs.try_num,
27 task_states.status
28 FROM
29 task_states
30 LEFT OUTER JOIN
31 task_jobs
32 ON
33 task_states.name == task_jobs.name
34 AND
35 task_states.cycle == task_jobs.cycle
36 AND
37 task_states.submit_num == task_jobs.submit_num
38 WHERE
39 task_states.name != '${CYLC_TASK_NAME}'
40 ORDER BY
41 task_states.name, task_states.cycle
42 ;"