mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-22 03:37:43 +00:00
stop notifying old server
This commit is contained in:
parent
221de1d2b6
commit
fb01cf91bc
1 changed files with 0 additions and 17 deletions
|
@ -4,7 +4,6 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
@ -188,22 +187,6 @@ func (a *api) upsertAccountsHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
_ = a.accountRepo.Disassociate(ctx, &acc, &dev)
|
_ = a.accountRepo.Disassociate(ctx, &acc, &dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
body := fmt.Sprintf(`{"apns_token": "%s"}`, apns)
|
|
||||||
req, err := http.NewRequestWithContext(ctx, "POST", "https://apollopushserver.xyz/api/new-server-addition", strings.NewReader(body))
|
|
||||||
if err != nil {
|
|
||||||
a.logger.Error("could not setup request to disassociate from legacy api", zap.Error(err), zap.String("apns", apns))
|
|
||||||
w.WriteHeader(http.StatusOK)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
req.Header.Set("Authorization", "Bearer 98g5j89aurqwfcsp9khlnvgd38fa15")
|
|
||||||
resp, _ := a.httpClient.Do(req)
|
|
||||||
if err != nil {
|
|
||||||
a.logger.Error("failed to remove from old notification server", zap.Error(err), zap.String("apns", apns))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
resp.Body.Close()
|
|
||||||
|
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue