dot_0620 2017-05-26 06:18 采纳率: 100%
浏览 56
已采纳

GAE / Go挂在本地开发服务器上

I am developing GAE/Go + gin application.

We have now about 25 handlers like this.

func init() {
    r := gin.New()
    r.POST("/path/to/some1", func1)   //  ^
    r.POST("/path/to/some2", func2)   //  |
            :                         //  | about 25 handlers
    r.POST("/path/to/someX", funcX)   //  v
}

I added another handler funcY to above code. and I invoked local development server, but it hangs up during start up.

func init() {                         // Hang up during start up.
    r := gin.New()
    r.POST("/path/to/some1", func1)   
    r.POST("/path/to/some2", func2)   
            :                         
    r.POST("/path/to/someX", funcX)   
    r.POST("/path/to/someY", funcY)   
}

The console log is as below. No message after this.

"C:\Program Files (x86)\JetBrains\Gogland 171.3780.106\binunnerw.exe" C:/go_appengine\goapp.bat serve C:/path/to/app.yaml
INFO     2017-05-26 15:03:02,552 devappserver2.py:764] Skipping SDK update check.
INFO     2017-05-26 15:03:02,996 api_server.py:268] Starting API server at: http://localhost:56094
INFO     2017-05-26 15:03:03,000 dispatcher.py:199] Starting module "default" running at: http://localhost:8080
INFO     2017-05-26 15:03:03,000 admin_server.py:116] Starting admin server at: http://localhost:8000

funcY has no problem because when I remove func1, it starts up normally.

func init() {                         // This works without problem.
    r := gin.New()
    r.POST("/path/to/some2", func2)   
            :                         
    r.POST("/path/to/someX", funcX)   
    r.POST("/path/to/someY", funcY)   
}

Does gin have maximum number of handler? If so, how can I raise it? Or do I have another way to solve this?

[UPDATE] This looks to be the local development server problem. When I deployed to the actual GAE, my app works without problem. How can I solve this problem in the local development server?

  • 写回答

1条回答 默认 最新

  • dotelauv682684 2017-05-27 01:15
    关注

    Self resolved.

    I set gin to release mode and my app works fine.

    gin.SetMode(gin.ReleaseMode)
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器