2024-09-10 18:53:45 +02:00
|
|
|
package agent
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"github.com/openziti/zrok/agent/agentGrpc"
|
2024-09-10 19:46:17 +02:00
|
|
|
"github.com/pkg/errors"
|
2024-09-10 18:53:45 +02:00
|
|
|
"github.com/sirupsen/logrus"
|
|
|
|
)
|
|
|
|
|
2024-09-18 17:54:37 +02:00
|
|
|
func (i *agentGrpcImpl) ReleaseShare(_ context.Context, req *agentGrpc.ReleaseShareRequest) (*agentGrpc.ReleaseShareResponse, error) {
|
2024-09-25 17:06:06 +02:00
|
|
|
if shr, found := i.agent.shares[req.Token]; found {
|
|
|
|
i.agent.rmShare <- shr
|
2024-09-12 19:07:27 +02:00
|
|
|
logrus.Infof("released share '%v'", shr.token)
|
2024-09-24 20:52:20 +02:00
|
|
|
|
2024-09-10 19:46:17 +02:00
|
|
|
} else {
|
|
|
|
return nil, errors.Errorf("agent has no share with token '%v'", req.Token)
|
|
|
|
}
|
2024-09-10 18:53:45 +02:00
|
|
|
return nil, nil
|
|
|
|
}
|