mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-24 19:39:11 +00:00
chore(worker-emulator): fix some QoL issues
This commit is contained in:
parent
89fbb01142
commit
55c2f8615c
2 changed files with 5 additions and 4 deletions
|
@ -20,7 +20,7 @@ class KVShim {
|
||||||
});
|
});
|
||||||
|
|
||||||
(async () => {
|
(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));
|
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);
|
return this.level.del(key);
|
||||||
}
|
};
|
||||||
|
|
||||||
list() {
|
list() {
|
||||||
console.warn('List is frowned upon and will fail to fetch keys in the emulator.');
|
console.warn('List is frowned upon and will fail to fetch keys in the emulator.');
|
||||||
|
|
|
@ -71,7 +71,7 @@ const server = http.createServer((req, res) => {
|
||||||
const event = {
|
const event = {
|
||||||
respondWith: async (value) => {
|
respondWith: async (value) => {
|
||||||
const timeStart = Date.now();
|
const timeStart = Date.now();
|
||||||
let loggedStatus = 'xxx';
|
let loggedStatus;
|
||||||
try {
|
try {
|
||||||
const response = await value;
|
const response = await value;
|
||||||
if (!response) {
|
if (!response) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue