mirror of
https://github.com/openziti/zrok.git
synced 2025-06-25 04:02:15 +02:00
don't try to replace policies for deleted shares (#276)
This commit is contained in:
parent
31819b42ba
commit
bd4ce22d97
@ -33,6 +33,7 @@ func (a *accountRelaxAction) HandleAccount(acct *store.Account, _, _ int64, _ *B
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, shr := range shrs {
|
for _, shr := range shrs {
|
||||||
|
if !shr.Deleted {
|
||||||
if shr.ShareMode == "public" {
|
if shr.ShareMode == "public" {
|
||||||
env, err := a.str.GetEnvironment(shr.EnvironmentId, trx)
|
env, err := a.str.GetEnvironment(shr.EnvironmentId, trx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -54,6 +55,7 @@ func (a *accountRelaxAction) HandleAccount(acct *store.Account, _, _ int64, _ *B
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ func (a *environmentRelaxAction) HandleEnvironment(env *store.Environment, rxByt
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, shr := range shrs {
|
for _, shr := range shrs {
|
||||||
|
if !shr.Deleted {
|
||||||
if shr.ShareMode == "public" {
|
if shr.ShareMode == "public" {
|
||||||
env, err := a.str.GetEnvironment(shr.EnvironmentId, trx)
|
env, err := a.str.GetEnvironment(shr.EnvironmentId, trx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -47,6 +48,7 @@ func (a *environmentRelaxAction) HandleEnvironment(env *store.Environment, rxByt
|
|||||||
return errors.New("share relax for private share not implemented")
|
return errors.New("share relax for private share not implemented")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ func newShareRelaxAction(str *store.Store, edge *rest_management_api_client.Ziti
|
|||||||
func (a *shareRelaxAction) HandleShare(shr *store.Share, rxBytes, txBytes int64, limit *BandwidthPerPeriod, trx *sqlx.Tx) error {
|
func (a *shareRelaxAction) HandleShare(shr *store.Share, rxBytes, txBytes int64, limit *BandwidthPerPeriod, trx *sqlx.Tx) error {
|
||||||
logrus.Infof("relaxing '%v'", shr.Token)
|
logrus.Infof("relaxing '%v'", shr.Token)
|
||||||
|
|
||||||
|
if !shr.Deleted {
|
||||||
if shr.ShareMode == "public" {
|
if shr.ShareMode == "public" {
|
||||||
env, err := a.str.GetEnvironment(shr.EnvironmentId, trx)
|
env, err := a.str.GetEnvironment(shr.EnvironmentId, trx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -40,6 +41,7 @@ func (a *shareRelaxAction) HandleShare(shr *store.Share, rxBytes, txBytes int64,
|
|||||||
} else if shr.ShareMode == "private" {
|
} else if shr.ShareMode == "private" {
|
||||||
return errors.New("share relax for private share not implemented")
|
return errors.New("share relax for private share not implemented")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user