Skip to content

Commit

Permalink
Merge pull request #4 from aussiegeek/master
Browse files Browse the repository at this point in the history
Set limits at start so we don't have file openning issues on OS X (#3)
  • Loading branch information
gravityblast committed Jan 28, 2014
2 parents fe7fa24 + f6e0ef3 commit 150192b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions runner/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"os"
"runtime"
"strings"
"syscall"
"time"
)

Expand Down Expand Up @@ -87,6 +88,16 @@ func initLogFuncs() {
appLog = newLogFunc("app")
}

func initLimit() {
var rLimit syscall.Rlimit
rLimit.Max = 10000
rLimit.Cur = 10000
err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit)
if err != nil {
fmt.Println("Error Setting Rlimit ", err)
}
}

func setEnvVars() {
os.Setenv("DEV_RUNNER", "1")
wd, err := os.Getwd()
Expand All @@ -103,6 +114,7 @@ func setEnvVars() {
// Watches for file changes in the root directory.
// After each file system event it builds and (re)starts the application.
func Start() {
initLimit()
initSettings()
initLogFuncs()
initFolders()
Expand Down

0 comments on commit 150192b

Please sign in to comment.