chore(worker-emulator): fix some QoL issues

This commit is contained in:
41666 2020-12-17 16:15:04 -05:00
parent 89fbb01142
commit 55c2f8615c
2 changed files with 5 additions and 4 deletions

View file

@ -20,7 +20,7 @@ class KVShim {
});
(async () => {
this.level = await level(path.resolve(__dirname, '../../.devdbs', namespace));
this.level = level(path.resolve(__dirname, '../../.devdbs', namespace));
})();
}
@ -82,9 +82,10 @@ class KVShim {
return await this.level.put(key, this.makeValue(value, expirationTtl));
}
async delete(key) {
// This loses scope for some unknown reason
delete = async (key) => {
return this.level.del(key);
}
};
list() {
console.warn('List is frowned upon and will fail to fetch keys in the emulator.');

View file

@ -71,7 +71,7 @@ const server = http.createServer((req, res) => {
const event = {
respondWith: async (value) => {
const timeStart = Date.now();
let loggedStatus = 'xxx';
let loggedStatus;
try {
const response = await value;
if (!response) {