From a3e56c31dce81b10cf26bb5a1b463ae3e1a03755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=B5=AB=E7=84=B6?= Date: Fri, 6 Sep 2024 10:39:43 +0800 Subject: [PATCH] Adjust position of check priviate key --- server/seaf-server.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/seaf-server.c b/server/seaf-server.c index f04cc4db..b9cf7632 100644 --- a/server/seaf-server.c +++ b/server/seaf-server.c @@ -1317,10 +1317,6 @@ main (int argc, char **argv) seafile_debug_set_flags_string (debug_str); private_key = g_getenv("JWT_PRIVATE_KEY"); - if (!private_key) { - seaf_warning ("Failed to read JWT_PRIVATE_KEY.\n"); - exit (1); - } if (seafile_dir == NULL) seafile_dir = g_build_filename (ccnet_dir, "seafile", NULL); @@ -1344,6 +1340,11 @@ main (int argc, char **argv) exit (0); } + if (!private_key) { + seaf_warning ("Failed to read JWT_PRIVATE_KEY.\n"); + exit (1); + } + seaf = seafile_session_new (central_config_dir, seafile_dir, ccnet_dir, private_key); if (!seaf) { seaf_warning ("Failed to create seafile session.\n");