dobo 2.38.0 → 2.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/extend/dobo/adapter/memory.js +3 -3
- package/package.json +1 -1
- package/wiki/CHANGES.md +4 -0
|
@@ -28,7 +28,7 @@ async function memoryAdapterFactory () {
|
|
|
28
28
|
async connect (connection, noRebuild) {
|
|
29
29
|
const conn = this.plugin.getConnection('memory')
|
|
30
30
|
const { fs } = this.app.lib
|
|
31
|
-
const {
|
|
31
|
+
const { startInterval } = this.app.lib
|
|
32
32
|
const dir = `${this.app.getPluginDataDir(this.plugin.ns)}/memDb/data` // persistence dir
|
|
33
33
|
fs.ensureDirSync(dir)
|
|
34
34
|
conn.persistences = conn.persistences ?? []
|
|
@@ -52,7 +52,7 @@ async function memoryAdapterFactory () {
|
|
|
52
52
|
else this.storage[model.name] = data
|
|
53
53
|
} else await model.loadFixtures({ ignoreError: false })
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
const handler = async () => {
|
|
56
56
|
if (!this.saving) return
|
|
57
57
|
this.saving = true
|
|
58
58
|
for (const model of models) {
|
|
@@ -64,7 +64,7 @@ async function memoryAdapterFactory () {
|
|
|
64
64
|
this.saving = false
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
startInterval(handler, this.plugin.config.memDb.persistenceDur, 'memDbPersistence')
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
async _getOldRecord (model, id, options = {}) {
|
package/package.json
CHANGED