all repos — honk @ 37d630b115420d758de93e8564c1ec5b54c70c2a

my fork of honk

don't try shrinking too many images at once
Ted Unangst tedu@tedunangst.com
Mon, 25 Nov 2019 21:50:51 -0500
commit

37d630b115420d758de93e8564c1ec5b54c70c2a

parent

79ff28a540ebb53a1b3c56e8baeddd46f2b7c8fa

1 files changed, 5 insertions(+), 0 deletions(-)

jump to
M backend.gobackend.go

@@ -23,6 +23,7 @@ "net/rpc"

"os" "os/exec" + "humungus.tedunangst.com/r/webs/gate" "humungus.tedunangst.com/r/webs/image" )

@@ -38,7 +39,11 @@ type ShrinkerResult struct {

Image *image.Image } +var shrinkgate = gate.NewLimiter(4) + func (s *Shrinker) Shrink(args *ShrinkerArgs, res *ShrinkerResult) error { + shrinkgate.Start() + defer shrinkgate.Finish() img, err := image.Vacuum(bytes.NewReader(args.Buf), args.Params) if err != nil { return err