Skip to content

Commit

Permalink
Merge pull request #88 from johannhof/master
Browse files Browse the repository at this point in the history
Wrap shared Vecs in Arc during document creation
  • Loading branch information
tak1n committed Apr 18, 2016
2 parents e41fd3a + c0cef98 commit e27b151
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cobalt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use yaml_rust::YamlLoader;
use chrono::{DateTime, UTC, FixedOffset};
use chrono::offset::TimeZone;
use rss::{Channel, Rss};
use std::sync::Arc;

macro_rules! walker {
($dir:expr) => {
Expand Down Expand Up @@ -100,8 +101,10 @@ pub fn build(config: &Config) -> Result<()> {
let mut handles = vec![];

// generate documents (in parallel)
// TODO I'm probably underutilizing crossbeam
crossbeam::scope(|scope| {
let post_data = Arc::new(post_data);
let layouts = Arc::new(layouts);

for doc in &documents {
trace!("Generating {}", doc.path);
let post_data = post_data.clone();
Expand Down

0 comments on commit e27b151

Please sign in to comment.