Closed ziyansuz closed 5 years ago
After the program starts, if the database does not exist, perform the refresh task.
There are a few ways, like db.iterator({ limit: 1 })
, db.createReadStream({ limit: 1 })
or just checking whether the directory on disk exists (unless you are using level
in the browser).
But a simpler solution might be to store something like the last refresh time in the db.
very well
Use db.get to show that 'Key not found in database'. what should I do?