Improve logging
This commit is contained in:
parent
d9f2da2519
commit
af88c101a7
1 changed files with 2 additions and 2 deletions
|
@ -140,7 +140,7 @@ func scan(ctx context.Context, id string) {
|
|||
slog.InfoContext(ctx, "File is New", "path", path)
|
||||
_, err = tx.Exec(ctx, "INSERT INTO files (library_id, path, size, missing) VALUES ($1, $2, $3, $4)", id, path, info.Size(), false)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Creating New File: %w", err)
|
||||
return fmt.Errorf("Add New File to DB: %w", err)
|
||||
}
|
||||
return nil
|
||||
} else if err != nil {
|
||||
|
@ -149,7 +149,7 @@ func scan(ctx context.Context, id string) {
|
|||
// File Exists so update Size and missing Status
|
||||
_, err = tx.Exec(ctx, "UPDATE files SET size = $1, missing = $2 WHERE id = $3", info.Size(), false, fileID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Creating New File: %w", err)
|
||||
return fmt.Errorf("Updating File in DB: %w", err)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue