air
air copied to clipboard
Binary not stopping on Ctrl + C on windows
OS: Windows 7 x64
Terminal: mintty 2.8.4 (MINGW64 git-scm)
Config:
# Config file for [Air](https://github.com/cosmtrek/air) in TOML format
# Working directory
# . or absolute path, please note that the directories following must be under root
root = "."
# Optional! If `watch_dir` is empty, use `root`.
watch_dir = ""
tmp_dir = "tmp"
[build]
# Just plain old shell command. You could use `make` as well.
cmd = "govvv build"
# Binary file yields from `cmd`.
bin = "./api.exe"
# This log file places in your tmp_dir.
log = "air_errors.log"
# Watch these filename extensions.
include_ext = ["go", "tpl", "tmpl", "html", "env"]
# Ignore these filename extensions or directories.
exclude_dir = ["migrations", "assets", "tmp", "vendor"]
# There's no necessary to trigger build each time file changes if it's too frequency.
delay = 1500 # ms
# Stop to run old binary when build errors occur.
stop_on_error = true
[log]
# Show log time
time = false
[color]
# Customize each part's color. If no color found, use the raw app log.
main = "magenta"
watcher = "cyan"
build = "yellow"
runner = "green"
# app = "white"
Steps to reproduce:
- Create go project with
http.ListenAndServe
and a blank handler. - Start Air
air
in Terminal - Access the handler endpoint exmaple:
http://localhost.com:1234/my_endpoint/
- Ctrl + C in Terminal.
Air is closed but binary is still running when checked in Task Manager.
print:
cleaning...
deleting E:\WorkPlace\gin_app\tmp
failed to delete tmp dir, err: remove E:\WorkPlace\gin_app\tmp\main.exe: Access is denied.
see you again~
and cmd window is still runing but http server is stoped
print:
cleaning... deleting E:\WorkPlace\gin_app\tmp failed to delete tmp dir, err: remove E:\WorkPlace\gin_app\tmp\main.exe: Access is denied. see you again~
and cmd window is still runing but http server is stoped
cloud you use Admin mode? it will clean the tmp files?
OS:
Windows 7 x64
Terminal:mintty 2.8.4 (MINGW64 git-scm)
Config:
# Config file for [Air](https://github.com/cosmtrek/air) in TOML format # Working directory # . or absolute path, please note that the directories following must be under root root = "." # Optional! If `watch_dir` is empty, use `root`. watch_dir = "" tmp_dir = "tmp" [build] # Just plain old shell command. You could use `make` as well. cmd = "govvv build" # Binary file yields from `cmd`. bin = "./api.exe" # This log file places in your tmp_dir. log = "air_errors.log" # Watch these filename extensions. include_ext = ["go", "tpl", "tmpl", "html", "env"] # Ignore these filename extensions or directories. exclude_dir = ["migrations", "assets", "tmp", "vendor"] # There's no necessary to trigger build each time file changes if it's too frequency. delay = 1500 # ms # Stop to run old binary when build errors occur. stop_on_error = true [log] # Show log time time = false [color] # Customize each part's color. If no color found, use the raw app log. main = "magenta" watcher = "cyan" build = "yellow" runner = "green" # app = "white"
Steps to reproduce:
- Create go project with
http.ListenAndServe
and a blank handler.- Start Air
air
in Terminal- Access the handler endpoint exmaple:
http://localhost.com:1234/my_endpoint/
- Ctrl + C in Terminal.
Air is closed but binary is still running when checked in Task Manager.
cloud you provide air log ? you mean air is stoped and your service is alive?
print:
cleaning... deleting E:\WorkPlace\gin_app\tmp failed to delete tmp dir, err: remove E:\WorkPlace\gin_app\tmp\main.exe: Access is denied. see you again~
and cmd window is still runing but http server is stoped
cloud you use Admin mode? it will clean the tmp files?
The tmp folder is deleted successfully when I close the cmd window and press Ctrl + C on vscode terminal , I don't know why the cmd window is not automatically close
I have same easy, I just change tmp dir so no access is denied error, but same issue when ctrl + c.
这个问题解决了吗?我的windows10也是这样的
cleaning...
deleting E:\WorkPlace\gin_app\tmp
failed to delete tmp dir, err: remove E:\WorkPlace\gin_app\tmp\main.exe: Access is denied.
see you again~
http服务一直在运行。文件修改后,日志显示:会重新编译,但在run的时候显示端口被占用。
应该是在终止前一个程序的进程时终止失败了,删除tmp目录也失败了,导致后面编译再跑时端口被占用,无法再次跑起来
Air's process (and goroutine) handling is too complex to work well. Please try arelo if you like.
这个问题解决了吗?我的windows10也是这样的
cleaning... deleting E:\WorkPlace\gin_app\tmp failed to delete tmp dir, err: remove E:\WorkPlace\gin_app\tmp\main.exe: Access is denied. see you again~
http服务一直在运行。文件修改后,日志显示:会重新编译,但在run的时候显示端口被占用。
应该是在终止前一个程序的进程时终止失败了,删除tmp目录也失败了,导致后面编译再跑时端口被占用,无法再次跑起来
解决了吗,我也出现了这个问题