mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-08 08:36:37 +08:00
prettier
This commit is contained in:
@@ -103,4 +103,4 @@ LIMIT ? OFFSET ?`, tableName, clause)
|
||||
logs = append(logs, item)
|
||||
}
|
||||
return logs, total, nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,4 +53,4 @@ func buildUserAccessLogFilterClause(filter AccessLogFilter) (string, []any, bool
|
||||
return "1", args, true
|
||||
}
|
||||
return strings.Join(parts, " AND "), args, true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,4 +167,4 @@ func GetTopActiveUsers(ctx context.Context, startTime time.Time, limit int) ([]T
|
||||
users = append(users, item)
|
||||
}
|
||||
return users, nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,4 +258,4 @@ func assignMockScanValue(dest any, value any) error {
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,4 +46,4 @@ func BatchInsert(ctx context.Context, logs []analyticsmodel.UserAccessLog) error
|
||||
return fmt.Errorf("send clickhouse batch: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,4 +27,4 @@ func ParseBrowserName(ua string) string {
|
||||
return "Safari"
|
||||
}
|
||||
return "Other"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,4 +10,4 @@ func safeInt64Count(count uint64) int64 {
|
||||
return math.MaxInt64
|
||||
}
|
||||
return int64(count)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,4 +30,3 @@ func TestSafeInt64Count(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -354,7 +354,7 @@ ORDER BY hour ASC`, nodeTrafficHourlyTableName, clause)
|
||||
result := make([]NodeTrafficHourly, 0)
|
||||
for rows.Next() {
|
||||
var (
|
||||
item NodeTrafficHourly
|
||||
item NodeTrafficHourly
|
||||
requestCount, errorCount, uniqueVisitorCount uint64
|
||||
)
|
||||
if err := rows.Scan(&item.NodeID, &item.Hour, &requestCount, &errorCount, &uniqueVisitorCount); err != nil {
|
||||
|
||||
@@ -222,4 +222,3 @@ func TestListNodeOpenrestyHourly_FallsBackToRawOnEmptyRollup(t *testing.T) {
|
||||
require.GreaterOrEqual(t, len(mock.queries), 2)
|
||||
assert.Contains(t, mock.queries[1], "lagInFrame")
|
||||
}
|
||||
|
||||
|
||||
@@ -324,4 +324,4 @@ func BatchInsertNodeObsFrpc(ctx context.Context, observations []analyticsmodel.N
|
||||
return fmt.Errorf("send clickhouse batch: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ func setupAuthSourceCacheTest(t *testing.T) (*gorm.DB, *miniredis.Miniredis, fun
|
||||
|
||||
db.SetDB(sqliteDB)
|
||||
db.Redis = redis.NewClient(&redis.Options{
|
||||
Addr: miniRedis.Addr(),
|
||||
Addr: miniRedis.Addr(),
|
||||
MaintNotificationsConfig: &maintnotifications.Config{
|
||||
Mode: maintnotifications.ModeDisabled,
|
||||
},
|
||||
@@ -237,4 +237,4 @@ func TestAuthSourceInvalidationPubSubClearsPeerRAM(t *testing.T) {
|
||||
if _, ok := authSourceActiveRAM.GetIfPresent(authSourceActiveRAMKey); ok {
|
||||
t.Fatal("expected peer RAM cache to be cleared by pub/sub")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user