mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-04-12 11:45:53 +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'
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue