Skip to content

Commit

Permalink
Merge pull request flyteorg#78 from lyft/fairness-hard-cap
Browse files Browse the repository at this point in the history
Fix token marshaling error in fairness V0
  • Loading branch information
bnsblue authored Mar 5, 2020
2 parents da14690 + fe6fb0a commit f8e88ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func (r *RedisResourceManager) AllocateResource(ctx context.Context, namespace p
return pluginCore.AllocationUndefined, err
}
// Check to see if the allocation token is already in the set
found, err := r.client.SIsMember(string(namespace), allocationToken)
found, err := r.client.SIsMember(string(namespace), string(allocationToken))
if err != nil {
logger.Errorf(ctx, "Error getting size of Redis set %v", err)
return pluginCore.AllocationUndefined, err
Expand Down Expand Up @@ -259,7 +259,7 @@ func (r *RedisResourceManager) AllocateResource(ctx context.Context, namespace p
return pluginCore.AllocationStatusExhausted, nil
}

countAdded, err := r.client.SAdd(string(namespace), allocationToken)
countAdded, err := r.client.SAdd(string(namespace), string(allocationToken))
if err != nil {
logger.Errorf(ctx, "Error adding token [%s:%s] %v", namespace, allocationToken, err)
return pluginCore.AllocationUndefined, err
Expand All @@ -272,7 +272,7 @@ func (r *RedisResourceManager) AllocateResource(ctx context.Context, namespace p
}

func (r *RedisResourceManager) ReleaseResource(ctx context.Context, namespace pluginCore.ResourceNamespace, allocationToken Token) error {
countRemoved, err := r.client.SRem(string(namespace), allocationToken)
countRemoved, err := r.client.SRem(string(namespace), string(allocationToken))
if err != nil {
logger.Errorf(ctx, "Error removing token [%v:%s] %v", namespace, allocationToken, err)
return err
Expand Down

0 comments on commit f8e88ac

Please sign in to comment.