mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-18 07:12:47 +03:00
refactor(core): compare plugin generations directly (#45728)
This commit is contained in:
committed by
GitHub
Unverified
parent
0c75b7b3c7
commit
09b0edd662
@@ -91,16 +91,11 @@ const layer = Layer.effect(
|
||||
|
||||
yield* lock.withPermit(
|
||||
Effect.gen(function* () {
|
||||
const next = definitions.map((definition) => ({ id: definition.id, version: definition.version }))
|
||||
const current = Array.from(active.values(), (entry) => ({
|
||||
id: entry.plugin.id,
|
||||
version: entry.plugin.version,
|
||||
}))
|
||||
if (
|
||||
current.length === next.length &&
|
||||
current.every((definition, index) => {
|
||||
const candidate = next[index]
|
||||
return definition.id === candidate?.id && definition.version === candidate.version
|
||||
active.size === definitions.length &&
|
||||
Array.from(active.values()).every((entry, index) => {
|
||||
const definition = definitions[index]
|
||||
return entry.plugin.id === definition?.id && entry.plugin.version === definition.version
|
||||
})
|
||||
) {
|
||||
const nextInventory = [...Array.from(active.values(), (entry) => activeInfo(entry.plugin)), ...failures]
|
||||
|
||||
Reference in New Issue
Block a user