Skip to content

Commit

Permalink
Fix session end hook for hourly-based subscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
bsrinivas8687 committed Aug 5, 2023
1 parent 78ed19e commit 74bbd31
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions x/subscription/keeper/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ func (k *Keeper) SessionInactiveHook(ctx sdk.Context, id uint64, accAddr sdk.Acc
return fmt.Errorf("subscription %d does not exist", id)
}

// If the subscription is a NodeSubscription with non-zero duration (hours), no further action is needed.
if s, ok := subscription.(*types.NodeSubscription); ok && s.Hours != 0 {
return nil
}

// Get the allocation associated with the subscription and account address.
alloc, found := k.GetAllocation(ctx, subscription.GetID(), accAddr)
if !found {
Expand Down

0 comments on commit 74bbd31

Please sign in to comment.