Fix loading of stats.json and subscriptions.json
All checks were successful
the build was successful
All checks were successful
the build was successful
This commit is contained in:
parent
bd733bac71
commit
f263b04661
|
@ -305,9 +305,7 @@ func (handler *subscriptionHandler) ServeHTTP(w http.ResponseWriter, r *http.Req
|
||||||
func (handler *subscriptionHandler) loadStats() error {
|
func (handler *subscriptionHandler) loadStats() error {
|
||||||
file, err := os.Open("./stats.json")
|
file, err := os.Open("./stats.json")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if os.IsExist(err) {
|
if os.IsNotExist(err) {
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
handler.Stats = make(map[string]Stat)
|
handler.Stats = make(map[string]Stat)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -321,9 +319,7 @@ func (handler *subscriptionHandler) loadStats() error {
|
||||||
func (handler *subscriptionHandler) loadSubscriptions() error {
|
func (handler *subscriptionHandler) loadSubscriptions() error {
|
||||||
file, err := os.Open("./subscription.json")
|
file, err := os.Open("./subscription.json")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if os.IsExist(err) {
|
if os.IsNotExist(err) {
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
handler.Subscribers = make(map[string][]Subscriber)
|
handler.Subscribers = make(map[string][]Subscriber)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user