publish in the background

This commit is contained in:
Sami Samhuri 2015-05-11 21:25:04 -07:00
parent 7a2338de6b
commit d02adf6b31

View file

@ -124,7 +124,9 @@ post '/publish' do
return 'forbidden'
end
blog.publish(@fields['env'])
Thread.new do
blog.publish(@fields['env'])
end
status 204
end
@ -208,7 +210,10 @@ post '/posts/drafts' do
if post = blog.create_post(title, body, link, id: id, draft: true)
if @fields['env']
post = blog.publish_post(post)
blog.publish(@fields['env'])
Thread.new do
blog.publish(@fields['env'])
end
@wait_for_compilation = false
end
url = url_for(post.url)
status 201