@alfe.ai/openclaw-database 0.0.15 → 0.0.16
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/dist/plugin2.cjs +8 -0
- package/dist/plugin2.js +8 -0
- package/package.json +1 -1
package/dist/plugin2.cjs
CHANGED
|
@@ -463,12 +463,19 @@ function ensureInitialized(client) {
|
|
|
463
463
|
});
|
|
464
464
|
return initPromise;
|
|
465
465
|
}
|
|
466
|
+
const ACTIVATED_KEY = "__alfeDatabasePluginActivated";
|
|
467
|
+
const g = globalThis;
|
|
466
468
|
const plugin = {
|
|
467
469
|
id: "@alfe.ai/openclaw-database",
|
|
468
470
|
name: "Alfe Database",
|
|
469
471
|
version: pkg.version,
|
|
470
472
|
activate(api) {
|
|
471
473
|
const log = api.logger;
|
|
474
|
+
if (g[ACTIVATED_KEY] === true) {
|
|
475
|
+
log.debug("Database plugin already activated — skipping duplicate");
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
g[ACTIVATED_KEY] = true;
|
|
472
479
|
log.info("Database plugin activating...");
|
|
473
480
|
let client;
|
|
474
481
|
try {
|
|
@@ -511,6 +518,7 @@ const plugin = {
|
|
|
511
518
|
else startDatabaseService();
|
|
512
519
|
},
|
|
513
520
|
async deactivate(api) {
|
|
521
|
+
g[ACTIVATED_KEY] = false;
|
|
514
522
|
api.logger.info("Database plugin deactivating...");
|
|
515
523
|
if (mongoClient) {
|
|
516
524
|
await mongoClient.close();
|
package/dist/plugin2.js
CHANGED
|
@@ -463,12 +463,19 @@ function ensureInitialized(client) {
|
|
|
463
463
|
});
|
|
464
464
|
return initPromise;
|
|
465
465
|
}
|
|
466
|
+
const ACTIVATED_KEY = "__alfeDatabasePluginActivated";
|
|
467
|
+
const g = globalThis;
|
|
466
468
|
const plugin = {
|
|
467
469
|
id: "@alfe.ai/openclaw-database",
|
|
468
470
|
name: "Alfe Database",
|
|
469
471
|
version: pkg.version,
|
|
470
472
|
activate(api) {
|
|
471
473
|
const log = api.logger;
|
|
474
|
+
if (g[ACTIVATED_KEY] === true) {
|
|
475
|
+
log.debug("Database plugin already activated — skipping duplicate");
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
g[ACTIVATED_KEY] = true;
|
|
472
479
|
log.info("Database plugin activating...");
|
|
473
480
|
let client;
|
|
474
481
|
try {
|
|
@@ -511,6 +518,7 @@ const plugin = {
|
|
|
511
518
|
else startDatabaseService();
|
|
512
519
|
},
|
|
513
520
|
async deactivate(api) {
|
|
521
|
+
g[ACTIVATED_KEY] = false;
|
|
514
522
|
api.logger.info("Database plugin deactivating...");
|
|
515
523
|
if (mongoClient) {
|
|
516
524
|
await mongoClient.close();
|