Skip to content

Commit a1b06d6

Browse files
authored
fix(account): resilient orgs fetch (anomalyco#16944)
1 parent 1b6820b commit a1b06d6

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

packages/opencode/src/account/service.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,17 @@ export class AccountService extends ServiceMap.Service<
192192

193193
const orgsByAccount = Effect.fn("AccountService.orgsByAccount")(function* () {
194194
const accounts = yield* repo.list()
195-
return yield* Effect.forEach(
195+
const [errors, results] = yield* Effect.partition(
196196
accounts,
197197
(account) => orgs(account.id).pipe(Effect.map((orgs) => ({ account, orgs }))),
198198
{ concurrency: 3 },
199199
)
200+
for (const error of errors) {
201+
yield* Effect.logWarning("failed to fetch orgs for account").pipe(
202+
Effect.annotateLogs({ error: String(error) }),
203+
)
204+
}
205+
return results
200206
})
201207

202208
const orgs = Effect.fn("AccountService.orgs")(function* (accountID: AccountID) {

0 commit comments

Comments
 (0)