Skip to content

Commit

Permalink
also set gc handler when making sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed Dec 2, 2024
1 parent 74323aa commit 13bc2d4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,8 @@ class Hypercore extends EventEmitter {
if (opts.preload) opts = { ...opts, ...(await opts.preload) }

if (opts.sessions && opts.sessions !== this.sessions) this.sessions = opts.sessions
if (opts.ongc) this.ongc = opts.ongc

this._sessionIndex = this.sessions.push(this) - 1

if (storage === null) storage = opts.storage || null
Expand Down

0 comments on commit 13bc2d4

Please sign in to comment.