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 如何能达到用ping0.cc检测成这样?如图
  • ¥15 关于#DMA固件#的问题,请各位专家解答!
  • ¥15 matlab生成的x1图不趋于稳定,之后的图像是稳定的水平线
  • ¥15 请问华为OD岗位的内部职业发展通道都有哪些,以及各个级别晋升的要求
  • ¥20 微信小程序 canvas 问题
  • ¥15 系统 24h2 专业工作站版,浏览文件夹的图库,视频,图片之类的怎样删除?
  • ¥15 怎么把512还原为520格式
  • ¥15 MATLAB的动态模态分解出现错误,以CFX非定常模拟结果为快照
  • ¥15 求高通平台Softsim调试经验