Tyk Gateway error - Failed to decode body: json: cannot unmarshal string into Go value of type []main.DBPolicy

Thank Richard,

It could indeed be an issue with the mutex, but a mutex works across threads / goroutines, so each time a read or a write occurs to the nonce it is locked, this will also lock any threads trying to access the resource. Mind you, because the other side will be iterating the nonce on the heartbeat, there’s a chance it changes dashboard side, even though it is correct gateway-side.

In fact, the simplest thing to do would actually be to move the heartbeat to after the initial load has occurs, since this causes the most nonce changes, it’s a tricky one.

M.