rename the options to mention it's a narinfo TTL as disk cache is used all over the place for other operations
This commit is contained in:
		
							parent
							
								
									33b08899d5
								
							
						
					
					
						commit
						62d75ad3e1
					
				
					 2 changed files with 6 additions and 6 deletions
				
			
		|  | @ -313,11 +313,11 @@ public: | ||||||
|     Setting<Strings> trustedUsers{this, {"root"}, "trusted-users", |     Setting<Strings> trustedUsers{this, {"root"}, "trusted-users", | ||||||
|         "Which users or groups are trusted to ask the daemon to do unsafe things."}; |         "Which users or groups are trusted to ask the daemon to do unsafe things."}; | ||||||
| 
 | 
 | ||||||
|     Setting<unsigned int> ttlNegativeDiskCache{this, 3600, "negative-disk-cache-ttl", |     Setting<unsigned int> ttlNegativeNarInfoCache{this, 3600, "narinfo-cache-negative-ttl", | ||||||
|         "The TTL in seconds for negative lookups in the disk cache i.e binary cache lookups that " |         "The TTL in seconds for negative lookups in the disk cache i.e binary cache lookups that " | ||||||
|         "return an invalid path result"}; |         "return an invalid path result"}; | ||||||
| 
 | 
 | ||||||
|     Setting<unsigned int> ttlPositiveDiskCache{this, 30 * 24 * 3600, "positive-disk-cache-ttl", |     Setting<unsigned int> ttlPositiveNarInfoCache{this, 30 * 24 * 3600, "narinfo-cache-positive-ttl", | ||||||
|         "The TTL in seconds for positive lookups in the disk cache i.e binary cache lookups that " |         "The TTL in seconds for positive lookups in the disk cache i.e binary cache lookups that " | ||||||
|         "return a valid path result."}; |         "return a valid path result."}; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -113,8 +113,8 @@ public: | ||||||
|                 SQLiteStmt(state->db, |                 SQLiteStmt(state->db, | ||||||
|                     "delete from NARs where ((present = 0 and timestamp < ?) or (present = 1 and timestamp < ?))") |                     "delete from NARs where ((present = 0 and timestamp < ?) or (present = 1 and timestamp < ?))") | ||||||
|                     .use() |                     .use() | ||||||
|                     (now - settings.ttlNegativeDiskCache) |                     (now - settings.ttlNegativeNarInfoCache) | ||||||
|                     (now - settings.ttlPositiveDiskCache) |                     (now - settings.ttlPositiveNarInfoCache) | ||||||
|                     .exec(); |                     .exec(); | ||||||
| 
 | 
 | ||||||
|                 debug("deleted %d entries from the NAR info disk cache", sqlite3_changes(state->db)); |                 debug("deleted %d entries from the NAR info disk cache", sqlite3_changes(state->db)); | ||||||
|  | @ -183,8 +183,8 @@ public: | ||||||
|             auto queryNAR(state->queryNAR.use() |             auto queryNAR(state->queryNAR.use() | ||||||
|                 (cache.id) |                 (cache.id) | ||||||
|                 (hashPart) |                 (hashPart) | ||||||
|                 (now - settings.ttlNegativeDiskCache) |                 (now - settings.ttlNegativeNarInfoCache) | ||||||
|                 (now - settings.ttlPositiveDiskCache)); |                 (now - settings.ttlPositiveNarInfoCache)); | ||||||
| 
 | 
 | ||||||
|             if (!queryNAR.next()) |             if (!queryNAR.next()) | ||||||
|                 return {oUnknown, 0}; |                 return {oUnknown, 0}; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue