Skip to content

Commit

Permalink
Cleanup imagick references
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Berhent committed Sep 3, 2022
1 parent 3e6e283 commit 8a51695
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
1 change: 0 additions & 1 deletion server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ require (
github.com/jasonlvhit/gocron v0.0.1
github.com/recws-org/recws v1.4.0
github.com/tdewolff/minify/v2 v2.12.0
gopkg.in/gographics/imagick.v3 v3.4.1
)

require (
Expand Down
2 changes: 0 additions & 2 deletions server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,6 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/gographics/imagick.v3 v3.4.1 h1:CClNBnd1UGxH9KAl4Vuwx+jgNRkyKN+cHlbuFPyt+KU=
gopkg.in/gographics/imagick.v3 v3.4.1/go.mod h1:+Q9nyA2xRZXrDyTtJ/eko+8V/5E7bWYs08ndkZp8UmA=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
Expand Down
14 changes: 5 additions & 9 deletions server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
socketio "github.com/googollee/go-socket.io"
"github.com/h2non/bimg"
"github.com/jasonlvhit/gocron"
"gopkg.in/gographics/imagick.v3/imagick"
)

func CorsMiddleware() gin.HandlerFunc {
Expand Down Expand Up @@ -94,9 +93,11 @@ func main() {
rpcClient = &net.RPCClient{Url: *rpcUrl}
}

// Setup magickwand
imagick.Initialize()
defer imagick.Terminate()
// Setup libvips
bimg.Initialize()
bimg.VipsCacheSetMaxMem(0)
bimg.VipsCacheSetMax(0)
defer bimg.Shutdown()

// Setup router
router := gin.Default()
Expand All @@ -121,11 +122,6 @@ func main() {

// Setup channel for stats processing job
statsChan := make(chan *gin.Context, 100)
// Setup libvips
bimg.Initialize()
bimg.VipsCacheSetMaxMem(0)
bimg.VipsCacheSetMax(0)
defer bimg.Shutdown()

// Setup natricon controller
natriconController := controller.NatriconController{
Expand Down

0 comments on commit 8a51695

Please sign in to comment.