commit 06302c6

default  ·  2024-01-10 08:16:40 +0000 UTC
parent 472ade7
Minor code cleaning.
2 files changed,  +3, -13
M snac.h
+2, -12
 1@@ -235,16 +235,6 @@ int server_get_handler(xs_dict *req, const char *q_path,
 2         *body  = xs_str_new("User-agent: *\n"
 3                             "Disallow: /\n");
 4     }
 5-    else
 6-    if (strcmp(q_path, "/status.txt") == 0) {
 7-        status = 200;
 8-        *ctype = "text/plain";
 9-        *body  = xs_str_new("UP\n");
10-
11-        xs *uptime = xs_str_time_diff(time(NULL) - p_state->srv_start_time);
12-        srv_log(xs_fmt("status: uptime: %s", uptime));
13-        srv_log(xs_fmt("status: job_fifo len: %d", p_state->job_fifo_size));
14-    }
15 
16     if (status != 0)
17         srv_debug(1, xs_fmt("server_get_handler serving '%s' %d", q_path, status));
18@@ -457,8 +447,8 @@ void job_post(const xs_val *job, int urgent)
19 
20         p_state->job_fifo_size++;
21 
22-        if (p_state->job_fifo_size > p_state->top_job_fifo_size)
23-            p_state->top_job_fifo_size = p_state->job_fifo_size;
24+        if (p_state->job_fifo_size > p_state->peak_job_fifo_size)
25+            p_state->peak_job_fifo_size = p_state->job_fifo_size;
26 
27         /* unlock the mutex */
28         pthread_mutex_unlock(&job_mutex);
M snac.h
+1, -1
1@@ -50,7 +50,7 @@ typedef struct {
2     int use_fcgi;           /* FastCGI use on/off */
3     time_t srv_start_time;  /* start time */
4     int job_fifo_size;      /* job fifo size */
5-    int top_job_fifo_size;  /* maximum job fifo size seen */
6+    int peak_job_fifo_size; /* maximum job fifo size seen */
7     int n_threads;          /* number of configured threads */
8     enum { THST_WAIT, THST_IN, THST_QUEUE, THST_STOP } th_state[MAX_THREADS];
9 } srv_state;