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 0610082
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/indexer-common/src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,14 @@ 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 === true
// TODO && isZeroPOI(action.poi)

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 0610082

Please sign in to comment.