Add noVerify flag to SaveEvent to prevent duplicate events and enhance test reliability
- pkg/database/save-event.go - Added `noVerify` parameter to `SaveEvent` function - Added check for existing event using `GetSerialById` when `noVerify` is false - Modified logic to handle event verification based on `noVerify` flag - pkg/app/relay/server-publish.go - Added `false` as third argument to `SaveEvent` calls - pkg/database/export_test.go - Added `false` as third argument to `SaveEvent` call - pkg/database/query-for-tags_test.go - Added `false` as third argument to `SaveEvent` call - pkg/database/query-for-kinds-authors_test.go - Added `false` as third argument to `SaveEvent` call - pkg/database/query-for-kinds-tags_test.go - Added `false` as third argument to `SaveEvent` call - pkg/database/query-for-serials_test.go - Added `false` as third argument to `SaveEvent` call - main.go - Modified pprof handling to support different profiling types (cpu, memory, allocation) - Changed `Pprof` configuration from boolean to string with enum values - pkg/app/config/config.go - Changed `Pprof` field type from `bool` to `string` with enum values - pkg/database/query-for-kinds-authors-tags_test.go - Added `false` as third argument to `SaveEvent` call - pkg/version/version - Bumped version from v0.2.12 to v0.2.13 - pkg/database/fetch-event-by-serial_test.go - Added `false` as third argument to `SaveEvent` call - pkg/database/query-for-kinds_test.go - Added `false` as third argument to `SaveEvent` call - pkg/database/get-serials-by-range_test.go - Added `false` as third argument to `SaveEvent` call - pkg/database/query-events-multiple-param-replaceable_test.go - Added `false` as third argument to `SaveEvent` calls - pkg/database/query-events_test.go - Added `false` as third argument to `SaveEvent` calls - pkg/interfaces/store/store_interface.go - Updated `Saver` interface to include `noVerify` parameter in `SaveEvent` method - Added `SerialByIder` interface with `GetSerialById` method - pkg/database/save-event_test.go - Added `false` as third argument to `SaveEvent` calls - Added new test case for saving existing event - pkg/database/query-for-ids_test.go - Added `false` as third argument to `SaveEvent` call - pkg/protocol/ws/client.go - Changed comment about context cancellation from "context is canceled" to "context is cancelled" - pkg/app/relay/spider-fetch.go - Added signature checker for WebSocket connections - Modified logic to check for existing events before saving - Added logging and memory optimization improvements
This commit is contained in:
@@ -72,7 +72,7 @@ type writeRequest struct {
|
||||
}
|
||||
|
||||
// NewRelay returns a new relay. The relay connection will be closed when the
|
||||
// context is canceled.
|
||||
// context is cancelled.
|
||||
func NewRelay(c context.T, url string, opts ...RelayOption) *Client {
|
||||
ctx, cancel := context.Cancel(c)
|
||||
r := &Client{
|
||||
|
||||
Reference in New Issue
Block a user