mirror of
https://github.com/owntracks/recorder.git
synced 2026-08-27 16:57:21 +00:00
init storage with TZ
This commit is contained in:
@@ -128,6 +128,7 @@ int ev_handler(struct mg_connection *conn, enum mg_event ev)
|
||||
return MG_TRUE;
|
||||
case MG_REQUEST:
|
||||
|
||||
|
||||
ctype = mg_get_header(conn, "accept");
|
||||
if (ctype != NULL)
|
||||
fprintf(stderr, "ACCEPT: %s\n", ctype);
|
||||
@@ -180,6 +181,8 @@ int ev_handler(struct mg_connection *conn, enum mg_event ev)
|
||||
return (MG_FALSE); /* Fail it */
|
||||
}
|
||||
|
||||
storage_init();
|
||||
|
||||
/* GET */
|
||||
if (!strcmp(conn->uri, "/api/me")) {
|
||||
push_geojson(conn);
|
||||
|
||||
@@ -26,6 +26,8 @@ void storage_init()
|
||||
{
|
||||
char path[BUFSIZ];
|
||||
|
||||
setenv("TZ", "UTC", 1);
|
||||
|
||||
snprintf(path, BUFSIZ, "%s/ghash", STORAGEDIR);
|
||||
gc = gcache_open(path, TRUE);
|
||||
}
|
||||
@@ -223,7 +225,6 @@ int make_times(char *time_from, time_t *s_lo, char *time_to, time_t *s_hi)
|
||||
{
|
||||
time_t now;
|
||||
|
||||
setenv("TZ", "UTC", 1); // FIXME: really?
|
||||
|
||||
time(&now);
|
||||
if (!time_from || !*time_from) {
|
||||
|
||||
Reference in New Issue
Block a user