diff options
author | Pacien | 2013-07-01 15:46:54 +0200 |
---|---|---|
committer | Pacien | 2013-07-01 15:46:54 +0200 |
commit | f4ea5b63f3539de1e2f08257db43cb2002ec65d0 (patch) | |
tree | 11f8aef2dc25e68f8ae9063391a132cb3c5777a1 /compiled.go | |
parent | c879511377bdb76615b58b212f030e82fb88d3be (diff) | |
download | foldaweb-f4ea5b63f3539de1e2f08257db43cb2002ec65d0.tar.gz |
Fix go routines sync delays
Diffstat (limited to 'compiled.go')
-rw-r--r-- | compiled.go | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/compiled.go b/compiled.go index 1cd391e..e7b7d0b 100644 --- a/compiled.go +++ b/compiled.go | |||
@@ -22,7 +22,6 @@ package main | |||
22 | import ( | 22 | import ( |
23 | "fmt" | 23 | "fmt" |
24 | "os" | 24 | "os" |
25 | "time" | ||
26 | ) | 25 | ) |
27 | 26 | ||
28 | func compiled(sourceDir, outputDir string, exts []string, saveAs string) { | 27 | func compiled(sourceDir, outputDir string, exts []string, saveAs string) { |
@@ -34,12 +33,10 @@ func compiled(sourceDir, outputDir string, exts []string, saveAs string) { | |||
34 | } | 33 | } |
35 | 34 | ||
36 | // compile everything | 35 | // compile everything |
36 | wait.Add(2) | ||
37 | go compile(sourceDir, make(map[string][]byte), sourceDir, outputDir, saveAs, exts, true) | 37 | go compile(sourceDir, make(map[string][]byte), sourceDir, outputDir, saveAs, exts, true) |
38 | go copyFiles(sourceDir, sourceDir, outputDir, exts, true) | 38 | go copyFiles(sourceDir, sourceDir, outputDir, exts, true) |
39 | 39 | ||
40 | // sleep some milliseconds to prevent early exit | ||
41 | time.Sleep(time.Millisecond * 100) | ||
42 | |||
43 | // wait until all tasks are completed | 40 | // wait until all tasks are completed |
44 | wait.Wait() | 41 | wait.Wait() |
45 | fmt.Println("Compilation done.") | 42 | fmt.Println("Compilation done.") |