From 8e4296e5bd59e38966db48d7eb912a71a197e506 Mon Sep 17 00:00:00 2001 From: Edmund Higham Date: Mon, 12 Apr 2021 19:14:16 +0100 Subject: [PATCH] [GH-1277] Prevent update loop from terminating (#364) Catch all throwables to make sure a workload failure doesn't bring down workflow-launcher. --- api/src/wfl/server.clj | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/api/src/wfl/server.clj b/api/src/wfl/server.clj index f7ce0761c..cc4d8234c 100644 --- a/api/src/wfl/server.clj +++ b/api/src/wfl/server.clj @@ -18,8 +18,7 @@ [wfl.service.postgres :as postgres] [wfl.util :as util] [wfl.wfl :as wfl]) - (:import (java.util.concurrent Future TimeUnit) - (org.postgresql.util PSQLException))) + (:import (java.util.concurrent Future TimeUnit))) (def description "The purpose of this command." @@ -88,9 +87,9 @@ (jdbc/with-db-transaction [tx (postgres/wfl-db-config)] (->> (workloads/load-workload-for-id tx id) (workloads/update-workload! tx))) - (catch PSQLException ex + (catch Throwable t (log/warnf "Failed to update workload %s" uuid) - (log/warn ex)))) + (log/warn t)))) (update-workloads! [] (log/info "updating workloads") (run! do-update!