mirror of
https://github.com/openziti/zrok.git
synced 2025-01-23 06:19:04 +01:00
more tolerance in zrokdir metadata checking (#134)
This commit is contained in:
parent
ee7c0fcca6
commit
2ec8a07d4b
@ -3,6 +3,7 @@ package zrokdir
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -19,7 +20,8 @@ func checkMetadata() error {
|
|||||||
}
|
}
|
||||||
data, err := os.ReadFile(mf)
|
data, err := os.ReadFile(mf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrapf(err, "error reading metadata file '%v'", mf)
|
logrus.Warnf("unable to read zrokdir metadata; ignoring non-existent: %v", err)
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
m := &Metadata{}
|
m := &Metadata{}
|
||||||
if err := json.Unmarshal(data, m); err != nil {
|
if err := json.Unmarshal(data, m); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user