mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-09 19:50:26 +03:00
Print the total running time at httpd stop.
This commit is contained in:
parent
7b349dd001
commit
920ff76297
2
Makefile
2
Makefile
@ -37,7 +37,7 @@ html.o: html.c xs.h xs_io.h xs_encdec.h xs_json.h xs_regex.h xs_set.h \
|
||||
http.o: http.c xs.h xs_io.h xs_encdec.h xs_openssl.h xs_curl.h xs_time.h \
|
||||
xs_json.h snac.h
|
||||
httpd.o: httpd.c xs.h xs_io.h xs_encdec.h xs_json.h xs_socket.h \
|
||||
xs_httpd.h xs_mime.h snac.h
|
||||
xs_httpd.h xs_mime.h xs_time.h snac.h
|
||||
main.o: main.c xs.h xs_io.h xs_encdec.h xs_json.h snac.h
|
||||
mastoapi.o: mastoapi.c xs.h xs_encdec.h xs_openssl.h xs_json.h xs_io.h \
|
||||
xs_time.h xs_glob.h snac.h
|
||||
|
6
httpd.c
6
httpd.c
@ -8,6 +8,7 @@
|
||||
#include "xs_socket.h"
|
||||
#include "xs_httpd.h"
|
||||
#include "xs_mime.h"
|
||||
#include "xs_time.h"
|
||||
|
||||
#include "snac.h"
|
||||
|
||||
@ -480,6 +481,7 @@ void httpd(void)
|
||||
pthread_t threads[MAX_THREADS] = {0};
|
||||
int n_threads = 0;
|
||||
int n;
|
||||
time_t start_time = time(NULL);
|
||||
|
||||
address = xs_dict_get(srv_config, "address");
|
||||
port = xs_number_get(xs_dict_get(srv_config, "port"));
|
||||
@ -566,5 +568,7 @@ void httpd(void)
|
||||
|
||||
sem_close(job_sem);
|
||||
|
||||
srv_log(xs_fmt("httpd stop %s:%d", address, port));
|
||||
xs *uptime = xs_str_time_diff(time(NULL) - start_time);
|
||||
|
||||
srv_log(xs_fmt("httpd stop %s:%d (run time: %s)", address, port, uptime));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user