gohugoio / hugo

The world’s fastest framework for building websites.
https://gohugo.io
Apache License 2.0
74.63k stars 7.45k forks source link

File watching takes a second to detect changes #4106

Closed asilgag closed 6 years ago

asilgag commented 6 years ago

In Ubuntu, sometimes "hugo server" takes a second to detect file changes before it can regenerate the site.

This does not happen all the time, but it is quite frequent, half the time more or less: sometimes it detects changes instantly, but other times it takes a second.

Steps to reproduce it:

sudo apt update
sudo apt install hugo
hugo new site quickstart
cd quickstart
git init
git submodule add https://github.com/budparr/gohugo-theme-ananke.git themes/ananke
echo 'theme = "ananke"' >> config.toml
hugo new posts/my-first-post.md
hugo server -D

Open a new console and place it side by side with the previous one. Then, trigger a WRITE command on a content:

touch -m content/posts/my-first-post.md 

Hugo will detect the file change, regenerating the site. Try the above command a few times to detect the problem.

"hugo env" outputs the following:

$ hugo env
Hugo Static Site Generator v0.30.2 linux/amd64 BuildDate: 2017-10-19T13:34:27+02:00
GOOS="linux"
GOARCH="amd64"
GOVERSION="go1.9.1"-
bep commented 6 years ago

I suggest you start by creating an issue here:

https://github.com/fsnotify/fsnotify

Note that I don't experience similar problems, but I'm on macOS, so this is perhaps OS/kernel version/disk... related. I don't know, but we're not staffed to track upstream issues on this level.

If you want to discuss this further, use the Hugo forum.

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.