diff options
author | devonh <devon.dmytro@gmail.com> | 2023-05-17 00:33:27 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-17 00:33:27 +0000 |
commit | 67d68768574a234b733eb3e4061644fc098a69f6 (patch) | |
tree | 819e9a0a150b68181d91112ffc7e0d6030412b77 /syncapi/sync | |
parent | 0489d16f95a3d9f1f5bc532e2060bd2482d7b156 (diff) |
Move MakeJoin logic to GMSL (#3081)
Diffstat (limited to 'syncapi/sync')
-rw-r--r-- | syncapi/sync/requestpool.go | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/syncapi/sync/requestpool.go b/syncapi/sync/requestpool.go index 09e5dee1..5a92c70e 100644 --- a/syncapi/sync/requestpool.go +++ b/syncapi/sync/requestpool.go @@ -536,12 +536,18 @@ func (rp *RequestPool) OnIncomingKeyChangeRequest(req *http.Request, device *use syncReq, err := newSyncRequest(req, *device, rp.db) if err != nil { util.GetLogger(req.Context()).WithError(err).Error("newSyncRequest failed") - return spec.InternalServerError() + return util.JSONResponse{ + Code: http.StatusInternalServerError, + JSON: spec.InternalServerError{}, + } } snapshot, err := rp.db.NewDatabaseSnapshot(req.Context()) if err != nil { logrus.WithError(err).Error("Failed to acquire database snapshot for key change") - return spec.InternalServerError() + return util.JSONResponse{ + Code: http.StatusInternalServerError, + JSON: spec.InternalServerError{}, + } } var succeeded bool defer sqlutil.EndTransactionWithCheck(snapshot, &succeeded, &err) @@ -552,7 +558,10 @@ func (rp *RequestPool) OnIncomingKeyChangeRequest(req *http.Request, device *use ) if err != nil { util.GetLogger(req.Context()).WithError(err).Error("Failed to DeviceListCatchup info") - return spec.InternalServerError() + return util.JSONResponse{ + Code: http.StatusInternalServerError, + JSON: spec.InternalServerError{}, + } } succeeded = true return util.JSONResponse{ |