blocky icon indicating copy to clipboard operation
blocky copied to clipboard

Prefetch syncs to redis

Open kwitsch opened this issue 1 year ago • 6 comments

Changes:

  • reloadCacheEntry removes EDNS0 records from response
  • reloadCacheEntry publishes its result to Redis

Closes #1422

Related #1420

kwitsch avatar Apr 12 '24 19:04 kwitsch

Codecov Report

Attention: Patch coverage is 62.98077% with 77 lines in your changes missing coverage. Please review.

Project coverage is 92.92%. Comparing base (fe84ab8) to head (7b2fcc2). Report is 147 commits behind head on main.

Files with missing lines Patch % Lines
util/dns.go 17.85% 44 Missing and 2 partials :warning:
redis/redis.go 80.64% 9 Missing and 9 partials :warning:
resolver/caching_resolver.go 76.78% 8 Missing and 5 partials :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1446      +/-   ##
==========================================
- Coverage   93.88%   92.92%   -0.97%     
==========================================
  Files          78       79       +1     
  Lines        6361     5030    -1331     
==========================================
- Hits         5972     4674    -1298     
+ Misses        300      251      -49     
- Partials       89      105      +16     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Apr 12 '24 19:04 codecov[bot]

@ThinkChaos I started refactoring the whole caching_resolver. May take a bit more time but I think there's some enhancement potential regarding code duplication and inconsistent behavior.

Thanks for the input. 👍

I'll let you know when I'm done.

kwitsch avatar Apr 13 '24 22:04 kwitsch

@ThinkChaos still needs some tests but may I get your opinion on the current changes? I'm a bit unsure if the direction I took was an advancement? 🤔

kwitsch avatar Apr 19 '24 22:04 kwitsch

I had to checkout the branch locally to browse with my editor cause it is indeed a lot of functions calling combined in a couple different ways so definitely hard to follow!

ThinkChaos avatar Apr 19 '24 23:04 ThinkChaos

I had to checkout the branch locally to browse with my editor cause it is indeed a lot of functions calling combined in a couple different ways so definitely hard to follow!

Yeah I know, that's one of the reasons why I was a bit unsure about the direction. 🫣

kwitsch avatar Apr 20 '24 00:04 kwitsch

Good thing I looked deeper into the caches since I found a remaining context.Background() : https://github.com/0xERR0R/blocky/blob/main/cache%2Fexpirationcache%2Fexpiration_cache.go#L129

kwitsch avatar Apr 20 '24 21:04 kwitsch