mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-04-27 14:57:40 +00:00
publish in the background
This commit is contained in:
parent
7a2338de6b
commit
d02adf6b31
1 changed files with 7 additions and 2 deletions
|
|
@ -124,7 +124,9 @@ post '/publish' do
|
||||||
return 'forbidden'
|
return 'forbidden'
|
||||||
end
|
end
|
||||||
|
|
||||||
blog.publish(@fields['env'])
|
Thread.new do
|
||||||
|
blog.publish(@fields['env'])
|
||||||
|
end
|
||||||
status 204
|
status 204
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -208,7 +210,10 @@ post '/posts/drafts' do
|
||||||
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 @fields['env']
|
||||||
post = blog.publish_post(post)
|
post = blog.publish_post(post)
|
||||||
blog.publish(@fields['env'])
|
Thread.new do
|
||||||
|
blog.publish(@fields['env'])
|
||||||
|
end
|
||||||
|
@wait_for_compilation = false
|
||||||
end
|
end
|
||||||
url = url_for(post.url)
|
url = url_for(post.url)
|
||||||
status 201
|
status 201
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue