2 Star 7 Fork 6

user_499098 / imgproxy

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.go 984 Bytes
一键复制 编辑 原始数据 按行查看 历史
DarthSim 提交于 2019-11-14 18:49 . Bump version
package main
import (
"log"
"os"
"os/signal"
"runtime"
"runtime/debug"
"syscall"
"time"
)
const version = "2.7.0"
type ctxKey string
func initialize() {
log.SetOutput(os.Stdout)
initLog()
configure()
initNewrelic()
initPrometheus()
initDownloading()
initErrorsReporting()
initVips()
if err := checkPresets(conf.Presets); err != nil {
shutdownVips()
logFatal(err.Error())
}
}
func main() {
initialize()
go func() {
var logMemStats = len(os.Getenv("IMGPROXY_LOG_MEM_STATS")) > 0
for range time.Tick(time.Duration(conf.FreeMemoryInterval) * time.Second) {
debug.FreeOSMemory()
if logMemStats {
var m runtime.MemStats
runtime.ReadMemStats(&m)
logDebug("MEMORY USAGE: Sys=%d HeapIdle=%d HeapInuse=%d", m.Sys/1024/1024, m.HeapIdle/1024/1024, m.HeapInuse/1024/1024)
}
}
}()
s := startServer()
stop := make(chan os.Signal, 1)
signal.Notify(stop, syscall.SIGINT, syscall.SIGTERM)
<-stop
shutdownServer(s)
shutdownVips()
}
Go
1
https://gitee.com/yunwisdoms/imgproxy.git
git@gitee.com:yunwisdoms/imgproxy.git
yunwisdoms
imgproxy
imgproxy
master

搜索帮助