Closed arabyalhomsi closed 4 years ago
https://github.com/paulodiovani/hacktoberrank/pull/27/commits/e342904ebac3d44638fc40ba0f4c52daac325a52 has the fixes that @paulodiovani indicated above, or what I understand from them so far. Now, adding users and their pull requests to redis is done in two requests to redis only (instead of pull requests getting inserted individually).
Checking on redis console. Good work. :smiley:
redis-server:6379> keys *
1) "pull-requests:2019:ejelome"
2) "pull-requests:2019:pull[bot]"
3) "pull-requests:2019:vangyyy"
4) "pull-requests:2019:stlrs08"
5) "pull-requests:2019:pamccombs"
6) "pull-requests:2019:dependabot-preview[bot]"
7) "pull-requests:2019:lwinfree"
8) "pull-requests:2019:kg-kartik"
9) "pull-requests:2019:donaldthai"
10) "pull-requests:2019:redwon"
11) "pull-requests:2019:dmheisel"
12) "pull-requests:2019:naman025"
13) "pull-requests:2019:andreshiguitaperez"
14) "pull-requests:2019:Axel936"
15) "pull-requests:2019:Aaron1011"
16) "pull-requests:2019:eoji"
17) "pull-requests:2019:snyk-bot"
18) "users:2019"
19) "pull-requests:2019:glotzbachs"
20) "pull-requests:2019:TheDropX"
21) "pull-requests:2019:andersonshatch"
22) "pull-requests:2019:nassafou"
23) "pull-requests:2019:rdxvsrmv"
24) "pull-requests:2019:Steverenner1"
25) "pull-requests:2019:rallen20"
redis-server:6379> zrevrange users:2019 0 3 WITHSCORES
1) "pull[bot]"
2) "4"
3) "dependabot-preview[bot]"
4) "3"
5) "snyk-bot"
6) "2"
7) "vangyyy"
8) "1"
redis-server:6379> smembers pull-requests:2019:pull[bot]
1) "https://github.com/us3r/sigma/pull/109"
2) "https://github.com/muescha/gatsby/pull/110"
3) "https://github.com/marcobebway/kyma/pull/1906"
4) "https://github.com/notpad/kubernetes/pull/80"
Maybe, in the future, we will have to filter out bots... :thinking:
Yes, I thought about that!
Now, only on the first request does our service interact with github API. After that, it only retrieves from redis. The keys for pull requests are like this
pull-requests:2019:@username
. Every year will have its different category.