MCPcopy Create free account
hub / github.com/adonisjs/session / commit

Method commit

src/client.ts:93–102  ·  view source on GitHub ↗

* Commits data to the session store * * @example * await client.commit() // Saves all changes to the store

()

Source from the content-addressed store, hash-verified

91 * await client.commit() // Saves all changes to the store
92 */
93 async commit() {
94 if (!this.#flashMessagesStore.isEmpty) {
95 this.#valuesStore.set(this.flashKey, this.#flashMessagesStore.toJSON())
96 }
97
98 debug('committing session data during api request')
99 if (!this.#valuesStore.isEmpty) {
100 this.#store.write(this.sessionId, this.#valuesStore.toJSON())
101 }
102 }
103
104 /**
105 * Destroys the session data from the store

Callers

nothing calls this directly

Calls 3

setMethod · 0.80
toJSONMethod · 0.80
writeMethod · 0.65

Tested by

no test coverage detected