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");