Conversation
|
|
||
| if !lastUpdate.IsZero() { | ||
| fmt.Printf("Last update: %s (%s ago)\n", lastUpdate.Format(time.RFC1123), time.Since(lastUpdate).Round(time.Second)) | ||
| if time.Since(lastUpdate) > (24 * time.Hour * 30) { |
There was a problem hiding this comment.
Can we make this some kind of constant so that it is not hardcoded in the middle of the code?
There was a problem hiding this comment.
Thank you, but the hardcoded constant "30" is still used in error messages.
vojtapolasek
left a comment
There was a problem hiding this comment.
In general I agree with the implementation and I acknowledge the reason; downloading many updates causes many small HTTP requests -> inefficiency -> actually higher amount of transfered data because if the user would download full database, it would be compressed.
I just have one thing apart from comments; could we put there some kind of command line parameter / env variable to override this behavior? I think a user should be given chance to go with the old way if they really wish so.
Very old databases can cause 1000+ http requests due getting every CVE. For very old database it is better to download the latest new archive. Created in part with Claude Code and Cursor.
Very old databases can causes 1000+ changes (ie. HTTP request) due getting every CVE listed in changes.csv getting updated. For very old database it is better to download the latest new archive.