()
| 265 | } |
| 266 | |
| 267 | setupFileWatcher() { |
| 268 | if (fs.existsSync(this.dbFile)) { |
| 269 | fs.watchFile(this.dbFile, (current, previous) => { |
| 270 | if (current.mtime !== previous.mtime) { |
| 271 | console.log('Database file changed, reloading data...') |
| 272 | this.reloadData() |
| 273 | } |
| 274 | }) |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | start() { |
| 279 | return new Promise((resolve, reject) => { |
no test coverage detected