fix: drop all db.task.batch() uses
This commit is contained in:
parent
1c8d542080
commit
38d3c9de41
1 changed files with 8 additions and 10 deletions
|
|
@ -171,7 +171,7 @@ function migrationSaveConfig(config) {
|
||||||
const loadLatest = schemaVersion =>
|
const loadLatest = schemaVersion =>
|
||||||
db
|
db
|
||||||
.task(t =>
|
.task(t =>
|
||||||
t.batch([
|
Promise.all([
|
||||||
loadLatestConfigOrNoneReturningVersion(t, schemaVersion),
|
loadLatestConfigOrNoneReturningVersion(t, schemaVersion),
|
||||||
_loadAccounts(t, schemaVersion),
|
_loadAccounts(t, schemaVersion),
|
||||||
]),
|
]),
|
||||||
|
|
@ -252,15 +252,13 @@ function loadConfig(db, versionId) {
|
||||||
function load(versionId) {
|
function load(versionId) {
|
||||||
if (!versionId) Promise.reject('versionId is required')
|
if (!versionId) Promise.reject('versionId is required')
|
||||||
|
|
||||||
return db.task(t => {
|
return db
|
||||||
t.batch([loadConfig(t, versionId), _loadAccounts(t)]).then(
|
.task(t => Promise.all([loadConfig(t, versionId), _loadAccounts(t)]))
|
||||||
([config, accounts]) => ({
|
.then(([config, accounts]) => ({
|
||||||
config,
|
config,
|
||||||
version: versionId,
|
version: versionId,
|
||||||
accounts,
|
accounts,
|
||||||
}),
|
}))
|
||||||
)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const fetchCurrentConfigVersion = () => {
|
const fetchCurrentConfigVersion = () => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue