koishi-plugin-adapter-onebot-multi 1.0.3 → 1.0.4
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/lib/index.js +8 -3
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1723,8 +1723,13 @@ var LoadBalancer = class {
|
|
|
1723
1723
|
}
|
|
1724
1724
|
}
|
|
1725
1725
|
if (assignments.length > 0) {
|
|
1726
|
-
|
|
1727
|
-
|
|
1726
|
+
const batchSize = 100;
|
|
1727
|
+
for (let i = 0; i < assignments.length; i += batchSize) {
|
|
1728
|
+
const slice = assignments.slice(i, i + batchSize);
|
|
1729
|
+
await Promise.all(slice.map(async ({ channelId, assignee }) => {
|
|
1730
|
+
await this.ctx.database.setChannel("onebot", channelId, { assignee });
|
|
1731
|
+
this.lastAssignees.set(channelId, assignee);
|
|
1732
|
+
}));
|
|
1728
1733
|
}
|
|
1729
1734
|
}
|
|
1730
1735
|
const botsWithData = onlineBots.filter((id) => {
|
|
@@ -2126,7 +2131,7 @@ var ConfigStore = class {
|
|
|
2126
2131
|
var Config = import_koishi9.Schema.object({}).description("配置已迁移到 data/adapter-onebot-multi/config.yaml");
|
|
2127
2132
|
var name = "adapter-onebot-multi";
|
|
2128
2133
|
var inject = {
|
|
2129
|
-
required: ["server"],
|
|
2134
|
+
required: ["server", "database"],
|
|
2130
2135
|
optional: ["console"]
|
|
2131
2136
|
};
|
|
2132
2137
|
function apply(ctx, _config) {
|