MCPcopy Create free account
hub / github.com/Permify/permify / IsSerializationRelatedError

Function IsSerializationRelatedError

internal/storage/postgres/utils/common.go:160–166  ·  view source on GitHub ↗

IsSerializationRelatedError checks if the error is a serialization failure, typically in database transactions.

(err error)

Source from the content-addressed store, hash-verified

158
159// IsSerializationRelatedError checks if the error is a serialization failure, typically in database transactions.
160func IsSerializationRelatedError(err error) bool {
161 if strings.Contains(err.Error(), "could not serialize") ||
162 strings.Contains(err.Error(), "duplicate key value") {
163 return true
164 }
165 return false
166}
167
168// WaitWithBackoff implements an exponential backoff strategy with jitter for retries.
169// It waits for a calculated duration or until the context is cancelled, whichever comes first.

Callers 5

WriteMethod · 0.92
DeleteMethod · 0.92
RunBundleMethod · 0.92
common_test.goFile · 0.92
HandleErrorFunction · 0.85

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected