Skip to content

Commit c37e8e4

Browse files
Merge pull request #35 from ScreepsMods/revert-34-issue/#33
Revert "When no file, dont try to read"
2 parents b1fdfa5 + 7e44948 commit c37e8e4

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

lib/adapters/file.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ class FileAdapter {
2020
}
2121
read (room, tick, callback) {
2222
const file = this.getFilePath(room, tick)
23-
if (!fs.existsSync(file)) {
24-
return Promise.resolve().asCallback(callback)
25-
}
2623
return Promise.resolve()
2724
.then(data => fs.readFileAsync(file))
2825
.then(data => zlib.gunzipAsync(data, 'utf8'))

lib/adapters/sqlite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class SqliteAdapter {
4242
try {
4343
const record = await History.findOne({ where: { room, tick } })
4444
if (!record) {
45-
return null
45+
throw new Error('Record not found')
4646
}
4747
const data = JSON.parse(await gunzip(record.data, 'utf8'))
4848
if (typeof callback === 'function') callback(null, data)

0 commit comments

Comments
 (0)