소스 검색

Disable libvips cache

DarthSim 7 년 전
부모
커밋
530964c30f
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      process.go

+ 4 - 2
process.go

@@ -98,8 +98,10 @@ func initVips() {
 		log.Fatalln("unable to start vips!")
 	}
 
-	C.vips_cache_set_max_mem(100 * 1024 * 1024) // 100Mb
-	C.vips_cache_set_max(500)
+	// Disable libvips cache. Since processing pipeline is fine tuned, we won't get much profit from it.
+	// Enabled cache can cause SIGSEGV on Musl-based systems like Alpine.
+	C.vips_cache_set_max_mem(0)
+	C.vips_cache_set_max(0)
 
 	if len(os.Getenv("IMGPROXY_VIPS_LEAK_CHECK")) > 0 {
 		C.vips_leak_set(C.gboolean(1))