binwiederhier преди 2 години
родител
ревизия
6f4b260035
променени са 4 файла, в които са добавени 3 реда и са изтрити 4 реда
  1. 1 1
      server/server_account_test.go
  2. 1 1
      server/server_matrix.go
  3. 1 1
      server/server_test.go
  4. 0 1
      server/topic.go

+ 1 - 1
server/server_account_test.go

@@ -705,7 +705,7 @@ func TestAccount_Persist_UserStats_After_Tier_Change(t *testing.T) {
 	t.Parallel()
 	conf := newTestConfigWithAuthFile(t)
 	conf.AuthDefault = user.PermissionReadWrite
-	conf.AuthStatsQueueWriterInterval = 100 * time.Millisecond
+	conf.AuthStatsQueueWriterInterval = 300 * time.Millisecond
 	s := newTestServer(t, conf)
 	defer s.closeDatabases()
 

+ 1 - 1
server/server_matrix.go

@@ -76,7 +76,7 @@ const (
 	// matrixRejectPushKeyForUnifiedPushTopicWithoutRateVisitorAfter is the time after which a Matrix response
 	// will return an HTTP 200 with the push key (i.e. "rejected":["<pushkey>"]}), if no rate visitor has been set on
 	// the topic. Rejecting the push key will instruct the Matrix server to invalidate the pushkey and stop sending
-	// messages to it. See https://spec.matrix.org/v1.6/push-gateway-api/
+	// messages to it. This must be longer than topicExpungeAfter. See https://spec.matrix.org/v1.6/push-gateway-api/
 	matrixRejectPushKeyForUnifiedPushTopicWithoutRateVisitorAfter = 12 * time.Hour
 )
 

+ 1 - 1
server/server_test.go

@@ -1357,7 +1357,7 @@ func TestServer_MatrixGateway_Push_Failure_NoSubscriber_After13Hours(t *testing.
 	s := newTestServer(t, c)
 	notification := `{"notification":{"devices":[{"pushkey":"http://127.0.0.1:12345/mytopic?up=1"}]}}`
 
-	// No success if no rate visitor set (this also creates the topic in memory
+	// No success if no rate visitor set (this also creates the topic in memory)
 	response := request(t, s, "POST", "/_matrix/push/v1/notify", notification, nil)
 	require.Equal(t, 507, response.Code)
 	require.Equal(t, 50701, toHTTPError(t, response.Body.String()).Code)

+ 0 - 1
server/topic.go

@@ -10,7 +10,6 @@ import (
 
 const (
 	// topicExpungeAfter defines how long a topic is active before it is removed from memory.
-	//
 	// This must be larger than matrixRejectPushKeyForUnifiedPushTopicWithoutRateVisitorAfter to give
 	// time for more requests to come in, so that we can send a {"rejected":["<pushkey>"]} response back.
 	topicExpungeAfter = 16 * time.Hour