diff options
| author | Shulhan <ms@kilabit.info> | 2018-08-30 11:44:35 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2018-08-30 16:43:11 +0700 |
| commit | 3698183aa701bc3bf3a967b64e4e843f34b66c0d (patch) | |
| tree | c0e04a92adb3505533a02ca4e09b62ce3b1eeccd /cacheworker.go | |
| parent | bc5ea8b85c014d7c95e21c4131304c0a0ea30fea (diff) | |
| download | rescached-3698183aa701bc3bf3a967b64e4e843f34b66c0d.tar.xz | |
Cache request to prevent forwarding the same queries to parent server
Diffstat (limited to 'cacheworker.go')
| -rw-r--r-- | cacheworker.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cacheworker.go b/cacheworker.go index 27fd455..b9bbd04 100644 --- a/cacheworker.go +++ b/cacheworker.go @@ -22,6 +22,7 @@ type cacheWorker struct { updateQueue chan *cacheResponse removeQueue chan *cacheResponse caches *caches + cachesRequest *cachesRequest cachesList *cachesList pruneDelay time.Duration cacheThreshold time.Duration @@ -33,6 +34,7 @@ func newCacheWorker(pruneDelay, cacheThreshold time.Duration) *cacheWorker { updateQueue: make(chan *cacheResponse, maxWorkerQueue), removeQueue: make(chan *cacheResponse, maxWorkerQueue), caches: newCaches(), + cachesRequest: newCachesRequest(), cachesList: newCachesList(cacheThreshold), pruneDelay: pruneDelay, cacheThreshold: cacheThreshold, |
