Skip to content

Commit 4acb645

Browse files
committed
core: add debug logging to troubleshoot share compaction loading
1 parent ef66403 commit 4acb645

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.opencode/opencode.jsonc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"$schema": "https://opencode.ai/config.json",
33
"plugin": ["opencode-openai-codex-auth"],
4-
// "enterprise": {
5-
// "url": "https://enterprise.dev.opencode.ai",
6-
// },
4+
"enterprise": {
5+
"url": "https://enterprise.dev.opencode.ai",
6+
},
77
"provider": {
88
"opencode": {
99
"options": {

packages/enterprise/src/core/share.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,19 @@ export namespace Share {
8585
}
8686

8787
export async function data(shareID: string) {
88+
console.log("reading compaction")
8889
const compaction: Compaction = (await Storage.read<Compaction>(["share_compaction", shareID])) ?? {
8990
data: [],
9091
event: undefined,
9192
}
92-
93+
console.log("reading pending events")
9394
const list = await Storage.list({
9495
prefix: ["share_event", shareID],
9596
end: compaction.event,
9697
}).then((x) => x.toReversed())
9798

99+
console.log("compacting", list.length)
100+
98101
const data = await Promise.all(list.map(async (event) => await Storage.read<Data[]>(event))).then((x) => x.flat())
99102
for (const item of data) {
100103
if (!item) continue

0 commit comments

Comments
 (0)