]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Maps: Jitter HTTP maps load to get better chances of SSL caching
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 18 Feb 2020 13:17:00 +0000 (13:17 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 18 Feb 2020 13:17:00 +0000 (13:17 +0000)
src/libserver/maps/map.c

index a837b11acdd3d934f209c80e91f79d7cd72af808..a832adc4fa6544619ee52cbcaeca68c74b6d8cb0 100644 (file)
@@ -1063,7 +1063,14 @@ rspamd_map_schedule_periodic (struct rspamd_map *map, int how)
                timeout = map->poll_timeout;
 
                if (how & RSPAMD_MAP_SCHEDULE_INIT) {
-                       timeout = 0.0;
+                       if (map->active_http) {
+                               /* Spill maps load to get better chances to hit ssl cache */
+                               timeout = rspamd_time_jitter (0.0, 2.0);
+                       }
+                       else {
+                               timeout = 0.0;
+                       }
+
                        reason = "init scheduled check";
                }
                else {