mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-03-25 09:05:47 +00:00
don't compile automatically
This commit is contained in:
parent
fc3c00687c
commit
c88590abd9
1 changed files with 0 additions and 19 deletions
|
|
@ -98,22 +98,6 @@ before do
|
|||
else
|
||||
@fields = {}
|
||||
end
|
||||
@wait_for_compilation = @fields['wait']
|
||||
end
|
||||
|
||||
after do
|
||||
compile = -> {
|
||||
start = Time.now
|
||||
if blog.compile_if_mutated
|
||||
duration = Time.now.to_f - start.to_f
|
||||
puts "Compiled blog in #{duration.round(2)}s"
|
||||
end
|
||||
}
|
||||
if @wait_for_compilation
|
||||
compile.call
|
||||
else
|
||||
Thread.new(&compile)
|
||||
end
|
||||
end
|
||||
|
||||
# favicon
|
||||
|
|
@ -223,7 +207,6 @@ post '/posts/drafts' do
|
|||
Thread.new do
|
||||
blog.publish(env)
|
||||
end
|
||||
@wait_for_compilation = false
|
||||
end
|
||||
url = url_for(post.url)
|
||||
status 201
|
||||
|
|
@ -300,7 +283,6 @@ post '/posts/drafts/:id/publish' do |id|
|
|||
|
||||
if post = blog.get_draft(id)
|
||||
new_post = blog.publish_post(post)
|
||||
@wait_for_compilation = true
|
||||
status 201
|
||||
headers 'Location' => url_for(new_post.url), 'Content-Type' => 'application/json'
|
||||
JSON.generate(post: new_post.fields)
|
||||
|
|
@ -417,7 +399,6 @@ post '/posts/:year/:month/:id/unpublish' do |year, month, id|
|
|||
|
||||
if post = blog.get_post(year, month, id)
|
||||
new_post = blog.unpublish_post(post)
|
||||
@wait_for_compilation = true
|
||||
status 200
|
||||
headers 'Location' => url_for(new_post.url), 'Content-Type' => 'application/json'
|
||||
JSON.generate(post: new_post.fields)
|
||||
|
|
|
|||
Loading…
Reference in a new issue