Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wait group for posts processing #8

Merged
merged 11 commits into from Oct 26, 2019
Merged

Conversation

egregors
Copy link
Contributor

resolve #7

@egregors
Copy link
Contributor Author

@freetonik this is a really big bunch of updates, but I believe these changes will make the project much more extendable and reliable.

So,

  • the project structure is idiomatically for golang now
  • a small pinch of "OOP" (Post, Blog structs and methods) nobody like "OOP", I know
  • all Post are processing in separate goroutines through the channel (CSP)
  • workers limit defines according to Rlimit / 2 if it possible (macOS, Linux), otherwise (Win) just use default limit (100)
  • thread-safe append posts

slug := filenameBase[11:]

// Get body from file
mdfile, err := os.Open("./markdown/" + filename)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this func should respect DefaultMarkdownPath, too. Accept path as param?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@freetonik Yep, you are right. This place should be refactored during the #10 implementation

@freetonik
Copy link
Owner

Whoa, amazing!

@freetonik freetonik merged commit dc1bb4c into freetonik:master Oct 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Concurrency problem
2 participants