From 1b9fa40237a83401b327a23dbec89af028610aa5 Mon Sep 17 00:00:00 2001 From: Zed Date: Sun, 7 Jun 2020 09:18:40 +0200 Subject: [PATCH] Silence Jester's query warning --- src/nitter.nim | 13 ++++++++++++- src/redis_cache.nim | 3 ++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/nitter.nim b/src/nitter.nim index 0ca4cae..56a2110 100644 --- a/src/nitter.nim +++ b/src/nitter.nim @@ -1,4 +1,4 @@ -import asyncdispatch +import asyncdispatch, logging, strformat from net import Port import jester @@ -12,11 +12,22 @@ import routes/[ const configPath {.strdefine.} = "./nitter.conf" let (cfg, fullCfg) = getConfig(configPath) +# Silence Jester's query warning +addHandler(newConsoleLogger()) +setLogFilter(lvlError) + +let http = if cfg.useHttps: "https" else: "http" +stdout.write &"Starting Nitter at {http}://{cfg.hostname}\n" +stdout.flushFile + updateDefaultPrefs(fullCfg) setCacheTimes(cfg) setHmacKey(cfg.hmacKey) waitFor initRedisPool(cfg) +stdout.write &"Connected to Redis at {cfg.redisHost}:{cfg.redisPort}\n" +stdout.flushFile + asyncCheck initTokenPool(cfg) createUnsupportedRouter(cfg) diff --git a/src/redis_cache.nim b/src/redis_cache.nim index 95a2537..fafd2eb 100644 --- a/src/redis_cache.nim +++ b/src/redis_cache.nim @@ -36,7 +36,8 @@ proc initRedisPool*(cfg: Config) {.async.} = await migrate("frosty", "*") except OSError: - echo "Failed to connect to Redis." + stdout.write "Failed to connect to Redis.\n" + stdout.flushFile quit(1) template toKey(p: Profile): string = "p:" & toLower(p.username)