Comments (14)
Thanks @mikegleasonjr!
from gin.
Glad my bump resulted in so much awesome 👍 🍻 😄
from gin.
How much file do you have in your path (recursively)?
It is possible that delay of 500ms (between two checks for changes) could be too small for you (if fs/cpu is too busy and can't process app requests in between).
We should consider adding that as a cli parameter (or consider using file/dirwatchers for detecting changes) if that proves to be your problem.
@codegangsta do you want me to do that?
from gin.
I have this problem as well, caused by one of those bloody node_modules
directories behemoths where I run Gin. Makes my CPU go nuts after a while.
The ability to specify which directories should be watched would be a huge improvement!
from gin.
+1 for that. node_modules is a real pain
from gin.
+1 mine too '___')
$ find . | wc
25589 27322 1452620
$ find . -type 'd' | wc
2052 2173 84120
$ find . -iname '*.go' | wc
144 144 3617
$ find .git | wc
83 83 2374
$ find resources/ | wc # this folder will never ever be compiled
24311 26044 1361828
$ find resources/ -type 'd' | wc
1935 2056 78388
an exclusion flag will be nice, for example:
gin -i -b /tmp/test --exclude resources/
from gin.
👍
Is this project dead? Any alternatives?
from gin.
#83 fixes this issue. Sadly it its unmerged.
I have a fork with that PR merged to master over at https://github.com/vektah/gin so it can be go get github.com/vektah/gin
from gin.
Bump...
from gin.
I ended up using fswatch:
Not a shell guru so bare with me:
$ fswatch -0 -or --include ".*\.go$" --exclude ".*" . | xargs -0 -t -n 1 -I {} go install -v github.com/your/server &
$ fswatch -0 -or $GOPATH/bin/server | xargs -0 -t -n 1 -I {} sh -c 'killall server; $GOPATH/bin/server &> optional.log &' &
The first line rebuilds and installs your package when *.go
changes, the second listens for a change of your installed server. (sometimes rebuilding does not yield a new binary, just a small optimization)
When I'm done, I killall fswatch
and killall server
. I was using prm anyway so I had startup and stop scripts at my disposition to automate that.
Lighter, more portable, faster, easier to run, etc..
from gin.
#83 is merged!
from gin.
I have excluded all huge directories with the excludeDir
but still cpu is about 40% on idle .(
mac os 10.12.4
from gin.
oops there was just a typo. All fixed.
from gin.
--excludeDir unnecessaryDir
especially directories with node_modules helps a lot (14% cpu usage to 0-2%)
from gin.
Related Issues (20)
- Support for args on binary HOT 2
- gRPC usage HOT 2
- error while access to url localhost:8080 HOT 4
- Feature request: Support TLS backends HOT 4
- Go get gin can't find urfave module HOT 4
- flag provided but not defined: -immediate HOT 1
- No connection could be made because the target machine actively refused it
- Upgrade wercker build to use docker version
- Auto assign port for proxy server
- Incorrect Usage: flag provided but not defined: -appPort HOT 3
- Build fails
- Has this project been abandoned? HOT 2
- go
- Broken build HOT 4
- Can add a monitoring build for static files?
- command.ProcessState could be nil
- No error log when use gin with dlv for remote debug. HOT 1
- Perhaps suggest go install command instead of go get HOT 1
- My file content hasn't changed, but gin always executes building.
- This exception occurs frequently
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gin.