Add a patch to fix an issue on first run
Sophie Brun
2 years ago
0 | From: Sophie Brun <[email protected]> | |
1 | Date: Tue, 17 Aug 2021 16:23:52 +0200 | |
2 | Subject: Create logs dir | |
3 | ||
4 | ||
5 | After first installation faraday will first fail because ~/.faraday/logs | |
6 | does not exist. After the failure when we run again faraday it works. | |
7 | Let's create the missing directory before it's required and before the | |
8 | failure. | |
9 | ||
10 | Last-Update: 2021-08-17 | |
11 | --- | |
12 | faraday/server/config.py | 3 +++ | |
13 | 1 file changed, 3 insertions(+) | |
14 | ||
15 | diff --git a/faraday/server/config.py b/faraday/server/config.py | |
16 | index 3ec9f2d..1d4fa9f 100644 | |
17 | --- a/faraday/server/config.py | |
18 | +++ b/faraday/server/config.py | |
19 | @@ -24,10 +24,13 @@ LOGGING_LEVEL = INFO | |
20 | ||
21 | FARADAY_BASE = Path(__file__).parent.parent | |
22 | FARADAY_SERVER_SESSIONS_DIR = CONST_FARADAY_HOME_PATH / 'session' | |
23 | +FARADAY_SERVER_LOGS_DIR = CONST_FARADAY_HOME_PATH / 'logs' | |
24 | if not CONST_FARADAY_HOME_PATH.exists(): | |
25 | CONST_FARADAY_HOME_PATH.mkdir() | |
26 | if not FARADAY_SERVER_SESSIONS_DIR.exists(): | |
27 | FARADAY_SERVER_SESSIONS_DIR.mkdir() | |
28 | +if not FARADAY_SERVER_LOGS_DIR.exists(): | |
29 | + FARADAY_SERVER_LOGS_DIR.mkdir() | |
30 | FARADAY_SERVER_PID_FILE = CONST_FARADAY_HOME_PATH / \ | |
31 | 'faraday-server-port-{0}.pid' | |
32 | REQUIREMENTS_FILE = FARADAY_BASE / 'requirements.txt' |