Skip to content

Commit

Permalink
Adjust position of check priviate key
Browse files Browse the repository at this point in the history
  • Loading branch information
杨赫然 committed Sep 6, 2024
1 parent e244b07 commit a3e56c3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions server/seaf-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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");
Expand Down

0 comments on commit a3e56c3

Please sign in to comment.