Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(db): add LastFetchedAt in fetchmeta #235

Merged
merged 3 commits into from
Jan 6, 2022

Conversation

MaineK00n
Copy link
Collaborator

@MaineK00n MaineK00n commented Dec 23, 2021

What did you implement:

Add the time when the fetch is completed to fetchmeta.

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

RDB

$ go-cve-dictionary fetch nvd
$ sqlite3 cve.sqlite3  
sqlite> SELECT last_fetched_at FROM fetch_meta;
2021-12-26 08:45:48.769925148+09:00

$ go-cve-dictionary fetch nvd
$ sqlite3 cve.sqlite3  
sqlite> SELECT last_fetched_at FROM fetch_meta;
2021-12-26 08:50:40.68298214+09:00

Redis

$ redis-cli -p 6379
127.0.0.1:6379> HGET CVE#FETCHMETA LastFetchedAt
(nil)

$ go-cve-dictionary fetch nvd --dbtype redis --dbpath "redis://127.0.0.1:6379/0"
$ redis-cli -p 6379
127.0.0.1:6379> HGET CVE#FETCHMETA LastFetchedAt
"2021-12-26T08:52:51.973265483+09:00"

$ go-cve-dictionary fetch nvd --dbtype redis --dbpath "redis://127.0.0.1:6379/0"
$ redis-cli -p 6379
127.0.0.1:6379> HGET CVE#FETCHMETA LastFetchedAt
"2021-12-26T08:54:48.1066968+09:00"

Checklist:

You don't have to satisfy all of the following.

  • Write tests
  • Write documentation
  • Check that there aren't other open pull requests for the same issue/feature
  • Format your source code by make fmt
  • Pass the test by make test
  • Provide verification config / commands
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES

Reference

@MaineK00n MaineK00n self-assigned this Dec 23, 2021
@MaineK00n MaineK00n marked this pull request as ready for review December 25, 2021 23:55
@MaineK00n MaineK00n force-pushed the MaineK00n/add-LastFetchedDate-fetchmeta branch from 5a24d2c to 03da417 Compare January 6, 2022 09:46
@kotakanbe kotakanbe merged commit 221f5bb into master Jan 6, 2022
@kotakanbe kotakanbe deleted the MaineK00n/add-LastFetchedDate-fetchmeta branch January 6, 2022 20:30
@MaineK00n MaineK00n changed the title feat(db): add LastFetchedDate in fetchmeta feat(db): add LastFetchedAt in fetchmeta Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants