Reactive publishing framework, filesystem-based with support for Markdown, nested hierarchies, and instant content rebuilding. Written in Elixir.
Apache License 2.0
115
stars
7
forks
source link
FileWatcher should create root_path when it doesn't exist; RepositoryWatcher should make the initial pull only after recheck_pending_remote_events_interval elapses #52
RepositoryWatcher pulls content from the remote_repository_url as soon as the application is started.
FileWatcher also starts listening for changes as soon as the application is started.
This sometimes creates rush conditions between RepositoryWatcher and FileWatcher, which leads to FileWatcher getting stuck, for example #51.
This is mainly because when using content from an external repository, the content root_path folder may still not exist in the server when the application is started, because the folder is created by RepositoryProviders.Git.
This only happens when remote_repository_url is set.
Proposed Solution
Upon application start, before FileWatcher starts watching for changes, it should check whether root_path exists, if not, creates it.
Validate configuration upon application start: crash if recheck_pending_remote_events_interval < recheck_pending_file_events_interval.
Add the validation as the first thing into PardallMarkdown.Application.start/2 or try something like Vapor (although Vapor doesn't support custom validators).
Docs should mention that recheck_pending_remote_events_interval must be greater than recheck_pending_file_events_interval.
RepositoryWatcher should start watching for changes after the first recheck_pending_remote_events_interval elapses.
Currently it starts pooling for changes right away, and uses recheck_pending_remote_events_interval only for subsequent pulls.
Problem
RepositoryWatcher
pulls content from theremote_repository_url
as soon as the application is started.FileWatcher
also starts listening for changes as soon as the application is started.This sometimes creates rush conditions between
RepositoryWatcher
andFileWatcher
, which leads toFileWatcher
getting stuck, for example #51.This is mainly because when using content from an external repository, the content
root_path
folder may still not exist in the server when the application is started, because the folder is created byRepositoryProviders.Git
.This only happens when
remote_repository_url
is set.Proposed Solution
FileWatcher
starts watching for changes, it should check whetherroot_path
exists, if not, creates it.recheck_pending_remote_events_interval
<recheck_pending_file_events_interval
.PardallMarkdown.Application.start/2
or try something like Vapor (although Vapor doesn't support custom validators).recheck_pending_remote_events_interval
must be greater thanrecheck_pending_file_events_interval
.RepositoryWatcher
should start watching for changes after the firstrecheck_pending_remote_events_interval
elapses.recheck_pending_remote_events_interval
only for subsequent pulls.