fix(xo-server/store): store.get returns a promise (#4776)

Fixes xoa-support#2137
This commit is contained in:
Pierre Donias 2020-02-04 11:14:41 +01:00 committed by GitHub
parent e6c8d6cc7d
commit cb16438b1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -11,6 +11,8 @@
> Users must be able to say: “I had this issue, happy to know it's fixed”
- [Self,IP pools] Fixed the creation being stuck and freezing XO (PR [#4776](https://github.com/vatesfr/xen-orchestra/pull/4776))
### Released packages
> Packages will be released in the order they are here, therefore, they should

View File

@ -4,7 +4,7 @@ import { ensureDir } from 'fs-extra'
// ===================================================================
const _levelHas = function has(key, cb) {
const _levelHas = async function has(key, cb) {
if (cb) {
return this.get(key, (error, value) =>
error ? (error.notFound ? cb(null, false) : cb(error)) : cb(null, true)
@ -12,7 +12,7 @@ const _levelHas = function has(key, cb) {
}
try {
this.get(key)
await this.get(key)
return true
} catch (error) {
if (!error.notFound) {