Skip to content

Commit 510f10c

Browse files
elboulangerojbkempf
authored andcommitted
scan: Log when the result of a mirror scan is commited to the database
So far, when a mirror is scanned, we have two logs: when it starts, and when it ends: ``` 2025/05/19 01:21:10.644 UTC [archive-4.kali.org] Requesting file list via rsync... 2025/05/19 01:22:42.670 UTC [archive-4.kali.org] Indexed 490848 files (490847 known), 3807 removed ``` We don't have a timestamp in the middle, to indicate that the scan is finished, and we're about to commit the result to the database. Too bad, as it's sometimes useful to know how long it took for the scan, and how long it took for the commit. And as we can see, when the source is scanned, we do have this information: ``` 2025/05/19 00:25:22.639 UTC [source] Scanning the filesystem... 2025/05/19 00:25:58.265 UTC [source] Indexing the files... 2025/05/19 00:26:02.360 UTC [source] Indexed 490848 files, 3807 removed ``` So this commit aligns the logs for mirror scan with the logs for source scan: it adds this extra log before starting the commit operation. Now the logs look like that: ``` 2025/05/19 01:21:10.644 UTC [archive-4.kali.org] Requesting file list via rsync... 2025/05/19 01:22:37.927 UTC [archive-4.kali.org] Indexing the files... 2025/05/19 01:22:42.670 UTC [archive-4.kali.org] Indexed 490848 files (490847 known), 3807 removed ```
1 parent 8065587 commit 510f10c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

scan/scan.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ func Scan(typ core.ScannerType, r *database.Redis, c *mirrors.Cache, url string,
149149
return nil, err
150150
}
151151

152+
log.Infof("[%s] Indexing the files...", name)
153+
152154
// Exec multi
153155
s.ScannerCommit()
154156

0 commit comments

Comments
 (0)