Skip to content

Commit

Permalink
Restore cleanup behavior on failed startup (#3119)
Browse files Browse the repository at this point in the history
  • Loading branch information
stbrody authored Jan 25, 2024
1 parent fea8b77 commit 7e7f91f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/anchor/ethereum/ethereum-anchor-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ export class EthereumAnchorService implements AnchorService {

async close(): Promise<void> {
this.#logger.debug(`Closing EthereumAnchorService`)
await this.#cas.close()
await this.#store.close()
await this.#cas?.close()
await this.#store?.close()
await this.#loop?.stop()
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/ceramic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ export class Ceramic implements StreamReaderWriter, StreamStateLoader {
await this._startupChecks()
} catch (err) {
this._logger.err(err)
await this.close()
throw err
}
}
Expand Down

0 comments on commit 7e7f91f

Please sign in to comment.