Skip to content

Commit

Permalink
fix: remove unused func
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-bisonai committed Aug 1, 2024
1 parent af0b75a commit 7da1ff6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
2 changes: 1 addition & 1 deletion node/pkg/dal/tests/stats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func TestWebsocketSubcription(t *testing.T) {
assert.NoError(t, err)
assert.Greater(t, id, int32(0))

err = stats.InsertWebsocketSubscription(ctx, id, "test_topic")
err = stats.InsertWebsocketSubscriptions(ctx, id, []string{"test_topic"})
assert.NoError(t, err)

result, err := db.QueryRows[WebsocketSubscription](ctx, "SELECT * FROM websocket_subscriptions", nil)
Expand Down
13 changes: 0 additions & 13 deletions node/pkg/dal/utils/stats/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ const (
SET connection_end = NOW(), duration = EXTRACT(EPOCH FROM (NOW() - timestamp)) * 1000
WHERE id = @id;
`

INSERT_WEBSOCKET_SUBSCRIPTIONS = `
INSERT INTO
websocket_subscriptions (connection_id, topic)
VALUES (@connection_id, @topic);
`
)

type websocketId struct {
Expand Down Expand Up @@ -64,13 +58,6 @@ func UpdateWebsocketConnection(ctx context.Context, connectionId int32) error {
})
}

func InsertWebsocketSubscription(ctx context.Context, connectionId int32, topic string) error {
return db.QueryWithoutResult(ctx, INSERT_WEBSOCKET_SUBSCRIPTIONS, map[string]any{
"connection_id": connectionId,
"topic": topic,
})
}

func InsertWebsocketSubscriptions(ctx context.Context, connectionId int32, topics []string) error {
entries := [][]any{}
for _, topic := range topics {
Expand Down

0 comments on commit 7da1ff6

Please sign in to comment.