mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-04-27 14:57:40 +00:00
use harp server for preview and use threads instead of forking
This commit is contained in:
parent
7231c7465b
commit
fc3c00687c
1 changed files with 5 additions and 5 deletions
|
|
@ -16,7 +16,7 @@ CONFIG_DEFAULTS = {
|
||||||
port: 6706,
|
port: 6706,
|
||||||
external_port: 6706,
|
external_port: 6706,
|
||||||
external_ssl: false,
|
external_ssl: false,
|
||||||
preview_port: 5000,
|
preview_port: 9000,
|
||||||
preview_ssl: false,
|
preview_ssl: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -112,7 +112,7 @@ after do
|
||||||
if @wait_for_compilation
|
if @wait_for_compilation
|
||||||
compile.call
|
compile.call
|
||||||
else
|
else
|
||||||
fork(&compile)
|
Thread.new(&compile)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -218,10 +218,10 @@ post '/posts/drafts' do
|
||||||
id, title, body, link = @fields.values_at('id', 'title', 'body', 'link')
|
id, title, body, link = @fields.values_at('id', 'title', 'body', 'link')
|
||||||
begin
|
begin
|
||||||
if post = blog.create_post(title, body, link, id: id, draft: true)
|
if post = blog.create_post(title, body, link, id: id, draft: true)
|
||||||
if @fields['env']
|
if env = @fields['env']
|
||||||
post = blog.publish_post(post)
|
post = blog.publish_post(post)
|
||||||
fork do
|
Thread.new do
|
||||||
blog.publish(@fields['env'])
|
blog.publish(env)
|
||||||
end
|
end
|
||||||
@wait_for_compilation = false
|
@wait_for_compilation = false
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue