Skip to content

Commit

Permalink
agent: allow expired allocations to be reallocated with force
Browse files Browse the repository at this point in the history
  • Loading branch information
dwerner committed Oct 23, 2024
1 parent c0933a7 commit cf37c4c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/indexer-common/src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@ export const validateActionInputs = async (
// allocationID must belong to active allocation
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const allocation = await networkMonitor.allocation(action.allocationID!)
if (allocation.status !== AllocationStatus.ACTIVE) {

const forcedReallocate = action.type === ActionType.REALLOCATE && action.force
if (forcedReallocate) {
logger.info(`forcing reallocate of id = '${action.allocationID}'`)
} else if (allocation.status !== AllocationStatus.ACTIVE) {
throw new Error(
`An active allocation does not exist with id = '${action.allocationID}'`,
)
Expand Down

0 comments on commit cf37c4c

Please sign in to comment.