fix: change interface{} to any in local_storage.go
This commit is contained in:
parent
366aac9edc
commit
368a3cf062
1 changed files with 3 additions and 8 deletions
|
|
@ -141,7 +141,7 @@ func (s *SQLiteStorage) StoreBatch(ctx context.Context, entries []LogEntry) erro
|
|||
|
||||
func (s *SQLiteStorage) Query(ctx context.Context, query StorageQuery) ([]LogEntry, error) {
|
||||
sqlQuery := "SELECT service, timestamp, type, host, tool, log_level, log_message, raw, priority, priority_name, unit, pid, boot_id, machine_id, fields, service_information, system_metrics, tool_information FROM log_entries WHERE 1=1"
|
||||
args := []interface{}{}
|
||||
args := []any{}
|
||||
argCount := 0
|
||||
|
||||
if !query.StartTime.IsZero() {
|
||||
|
|
@ -252,11 +252,11 @@ func (s *SQLiteStorage) MarkAsExported(ctx context.Context, ids []int64) error {
|
|||
}
|
||||
|
||||
placeholders := strings.Repeat("?,", len(ids))
|
||||
placeholders = placeholders[:len(placeholders)-1] // Remove trailing comma
|
||||
placeholders = placeholders[:len(placeholders)-1]
|
||||
|
||||
sqlQuery := fmt.Sprintf("UPDATE log_entries SET exported_at = CURRENT_TIMESTAMP WHERE id IN (%s)", placeholders)
|
||||
|
||||
args := make([]interface{}, len(ids))
|
||||
args := make([]any, len(ids))
|
||||
for i, id := range ids {
|
||||
args[i] = id
|
||||
}
|
||||
|
|
@ -266,11 +266,6 @@ func (s *SQLiteStorage) MarkAsExported(ctx context.Context, ids []int64) error {
|
|||
}
|
||||
|
||||
func (s *SQLiteStorage) GetUnexportedEntries(ctx context.Context, limit int) ([]LogEntry, error) {
|
||||
// query := StorageQuery{
|
||||
// Limit: limit,
|
||||
// OrderBy: "timestamp",
|
||||
// }
|
||||
|
||||
sqlQuery := `SELECT id, service, timestamp, type, host, tool, log_level, log_message, raw, priority, priority_name,
|
||||
unit, pid, boot_id, machine_id, fields, service_information, system_metrics, tool_information
|
||||
FROM log_entries WHERE exported_at IS NULL ORDER BY timestamp ASC`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue