Skip to content

Commit

Permalink
[agroal#462] Move init block
Browse files Browse the repository at this point in the history
  • Loading branch information
jesperpedersen committed Jun 13, 2024
1 parent 8e3f010 commit 79f5525
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,22 @@ main(int argc, char** argv)
errx(1, "Failed to start logging");
}

if (pgagroal_init_prometheus(&prometheus_shmem_size, &prometheus_shmem))
{
#ifdef HAVE_LINUX
sd_notifyf(0, "STATUS=Error in creating and initializing prometheus shared memory");
#endif
errx(1, "Error in creating and initializing prometheus shared memory");
}

if (pgagroal_init_prometheus_cache(&prometheus_cache_shmem_size, &prometheus_cache_shmem))
{
#ifdef HAVE_LINUX
sd_notifyf(0, "STATUS=Error in creating and initializing prometheus cache shared memory");
#endif
errx(1, "Error in creating and initializing prometheus cache shared memory");
}

if (pgagroal_validate_configuration(shmem, has_unix_socket, has_main_sockets))
{
#ifdef HAVE_LINUX
Expand Down Expand Up @@ -806,22 +822,6 @@ main(int argc, char** argv)
shmem = tmp_shmem;
config = (struct main_configuration*)shmem;

if (pgagroal_init_prometheus(&prometheus_shmem_size, &prometheus_shmem))
{
#ifdef HAVE_LINUX
sd_notifyf(0, "STATUS=Error in creating and initializing prometheus shared memory");
#endif
errx(1, "Error in creating and initializing prometheus shared memory");
}

if (pgagroal_init_prometheus_cache(&prometheus_cache_shmem_size, &prometheus_cache_shmem))
{
#ifdef HAVE_LINUX
sd_notifyf(0, "STATUS=Error in creating and initializing prometheus cache shared memory");
#endif
errx(1, "Error in creating and initializing prometheus cache shared memory");
}

if (getrlimit(RLIMIT_NOFILE, &flimit) == -1)
{
#ifdef HAVE_LINUX
Expand Down

0 comments on commit 79f5525

Please sign in to comment.