()
| 144 | } |
| 145 | |
| 146 | function updateSessionWatcher() { |
| 147 | console.info(`[updateSessionWatcher] PID: ${pid}`); |
| 148 | console.info('[updateSessionWatcher] Create workspaceWatcher'); |
| 149 | workspaceFile = path.join(sessionDir, 'workspace.json'); |
| 150 | workspaceLockFile = path.join(sessionDir, 'workspace.lock'); |
| 151 | workspaceTimeStamp = 0; |
| 152 | if (workspaceWatcher !== undefined) { |
| 153 | workspaceWatcher.close(); |
| 154 | } |
| 155 | if (fs.existsSync(workspaceLockFile)) { |
| 156 | workspaceWatcher = fs.watch(workspaceLockFile, {}, () => { |
| 157 | void updateWorkspace(); |
| 158 | }); |
| 159 | void updateWorkspace(); |
| 160 | } else { |
| 161 | console.info('[updateSessionWatcher] workspaceLockFile not found'); |
| 162 | } |
| 163 | |
| 164 | console.info('[updateSessionWatcher] Create plotWatcher'); |
| 165 | plotFile = path.join(sessionDir, 'plot.png'); |
| 166 | plotLockFile = path.join(sessionDir, 'plot.lock'); |
| 167 | plotTimeStamp = 0; |
| 168 | if (plotWatcher !== undefined) { |
| 169 | plotWatcher.close(); |
| 170 | } |
| 171 | if (fs.existsSync(plotLockFile)) { |
| 172 | plotWatcher = fs.watch(plotLockFile, {}, () => { |
| 173 | void updatePlot(); |
| 174 | }); |
| 175 | void updatePlot(); |
| 176 | } else { |
| 177 | console.info('[updateSessionWatcher] plotLockFile not found'); |
| 178 | } |
| 179 | console.info('[updateSessionWatcher] Done'); |
| 180 | } |
| 181 | |
| 182 | async function updatePlot() { |
| 183 | console.info(`[updatePlot] ${plotFile}`); |
no test coverage detected