Merge pull request #1887 from siiky/fix/lam-1454/settings-loader-tasks
LAM-1454 fix: drop all `db.task.batch()` uses
This commit is contained in:
commit
0937e03c77
1 changed files with 8 additions and 10 deletions
|
|
@ -171,7 +171,7 @@ function migrationSaveConfig(config) {
|
|||
const loadLatest = schemaVersion =>
|
||||
db
|
||||
.task(t =>
|
||||
t.batch([
|
||||
Promise.all([
|
||||
loadLatestConfigOrNoneReturningVersion(t, schemaVersion),
|
||||
_loadAccounts(t, schemaVersion),
|
||||
]),
|
||||
|
|
@ -252,15 +252,13 @@ function loadConfig(db, versionId) {
|
|||
function load(versionId) {
|
||||
if (!versionId) Promise.reject('versionId is required')
|
||||
|
||||
return db.task(t => {
|
||||
t.batch([loadConfig(t, versionId), _loadAccounts(t)]).then(
|
||||
([config, accounts]) => ({
|
||||
return db
|
||||
.task(t => Promise.all([loadConfig(t, versionId), _loadAccounts(t)]))
|
||||
.then(([config, accounts]) => ({
|
||||
config,
|
||||
version: versionId,
|
||||
accounts,
|
||||
}),
|
||||
)
|
||||
})
|
||||
}))
|
||||
}
|
||||
|
||||
const fetchCurrentConfigVersion = () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue