hugo/hugolib
Nate Finch 47c91a4ca2 Fix CreatePages
This fixes #450.  There are two problems:

1.) We're creating a new goroutine for every page.
2.) We're calling s.Pages = append(s.Pages, page) inside each goroutine.

1 is a problem if in that if you have a ton of pages, that's a ton of goroutines.  It's not really useful to have more than a few goroutines at a time, and lots can actually make your code much slower, and, evidently, crash.

2 is a problem in that append is not thread safe. Sometimes it returns a new slice with a larger capacity, when the original slice isn't large enough.  This can cause problems if two goroutines do this at the same time.

The solution for 1 is to use a limited number of workers (I chose 2*GOMAXPROCS as a nice guess).
The solution for 2 is to serialize access to s.Pages, which I did by doing it in a single goroutine.
2014-08-30 01:02:35 -04:00
..
benchmark_test.go
menu.go
node.go Adding IsNode & IsPage functions to Page & Node 2014-08-19 21:27:13 -04:00
page.go support for futre/draft summary info output 2014-08-20 14:21:15 -04:00
page_permalink_test.go Fix #302. Links now have trailing slashes. 2014-08-25 12:45:47 -04:00
page_taxonomy_test.go
page_test.go
page_time_integration_test.go
pageGroup.go Making direction optional (and setting defaults) for GroupBy Pages functionality. 2014-08-29 23:51:29 -04:00
pageSort.go
path_seperators_test.go
path_seperators_windows_test.go
permalinks.go
permalinks_test.go
planner.go
redis.cn.md
rss_test.go
shortcode.go Inner Shortcodes now treated as markdown. fixed #185 2014-08-28 12:48:31 -04:00
shortcode_test.go Inner Shortcodes now treated as markdown. fixed #185 2014-08-28 12:48:31 -04:00
site.go Fix CreatePages 2014-08-30 01:02:35 -04:00
site_show_plan_test.go
site_test.go Switch .Data to .Pages in the PageGroup functionality for increased consistency. 2014-08-29 23:48:24 -04:00
site_url_test.go
siteinfo_test.go
sitemap.go
sitemap_test.go
summary.go
taxonomy.go Making the term "Term" more consistent with Taxonomy usage. 2014-08-29 23:44:39 -04:00
taxonomy_test.go
template.go Add 'where' template function 2014-08-18 11:31:17 -04:00
template_embedded.go
template_test.go Add 'where' template function 2014-08-18 11:31:17 -04:00