Skip to content

Rule to set automatic renewal for allocations#366

Merged
hopeyen merged 1 commit intomainfrom
hope/allocation-auto-renewal
Feb 23, 2022
Merged

Rule to set automatic renewal for allocations#366
hopeyen merged 1 commit intomainfrom
hope/allocation-auto-renewal

Conversation

@hopeyen
Copy link
Copy Markdown
Contributor

@hopeyen hopeyen commented Feb 18, 2022

In addition to the feature to configure allocationLifetime, we also add the feature autoRenewal to indicate to the indexer agent if it should re-allocate to a particular deployment when it expires.

All the existing rules are given the default true. If you want to stop indexing a subgraph once it expires, use indexer-cli to set autoRenewal to false.

@hopeyen hopeyen force-pushed the hope/allocation-auto-renewal branch 5 times, most recently from 91e9245 to 9bdd42e Compare February 23, 2022 00:54
number: expiredAllocations.length,
expiredAllocations: expiredAllocations.map(allocation => allocation.id),
})
if (rule?.autoRenewal) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about merging this with the conditional that is one level up?

So it would be something like:
if (rule?.autoRenewal && expiredAllocation.length > 0) {...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I kept them separate was for the log info below. Do you think the message is useful? If not, I can merge them :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, ok. Let's leave it in.

Yeah, I think it's useful. It allows an indexer to see why their allocations aren't being reallocated to.

@hopeyen hopeyen force-pushed the hope/allocation-auto-renewal branch 2 times, most recently from f79a590 to df7db6a Compare February 23, 2022 01:21
@hopeyen hopeyen force-pushed the hope/allocation-auto-renewal branch from df7db6a to af64366 Compare February 23, 2022 01:22
Copy link
Copy Markdown
Contributor

@fordN fordN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@hopeyen hopeyen merged commit 20ba2ca into main Feb 23, 2022
@hopeyen hopeyen deleted the hope/allocation-auto-renewal branch February 23, 2022 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants