fix: use modelId instead of sessionId for unloading
The loop now extracts session info to retrieve the model ID, ensuring correct unloading of sessions by their associated model identifiers rather than session IDs. This aligns the cleanup process with the actual model resources being managed.
This commit is contained in:
parent
e3d6cbd80f
commit
331c0e04a5
@ -139,11 +139,11 @@ export default class llamacpp_extension extends AIEngine {
|
||||
|
||||
override async onUnload(): Promise<void> {
|
||||
// Terminate all active sessions
|
||||
for (const [sessionId, _] of this.activeSessions) {
|
||||
for (const [_, sInfo] of this.activeSessions) {
|
||||
try {
|
||||
await this.unload(sessionId)
|
||||
await this.unload(sInfo.modelId)
|
||||
} catch (error) {
|
||||
console.error(`Failed to unload session ${sessionId}:`, error)
|
||||
console.error(`Failed to unload model ${sInfo.modelId}:`, error)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user