forked from leftypol/leftypol
Refactor rebuilding after posts, finish reply requests before rebuilding index
This provides massive improvements to perceived post times as it doesn't wait for the entire board to rebuild index before confirming to the user that the post was made
This commit is contained in:
parent
9bf3c9a0ae
commit
cfaea67381
1 changed files with 24 additions and 15 deletions
31
post.php
31
post.php
|
@ -1449,24 +1449,33 @@ function handle_post(){
|
|||
));
|
||||
}
|
||||
|
||||
if ($config['try_smarter'] && $post['op'])
|
||||
$build_pages = range(1, $config['max_pages']);
|
||||
|
||||
if ($post['op'])
|
||||
if ($post['op']) {
|
||||
clean($id);
|
||||
|
||||
event('post-after', $post);
|
||||
if ($config['try_smarter'])
|
||||
$build_pages = range(1, $config['max_pages']);
|
||||
|
||||
buildIndex();
|
||||
event('post-after', $post);
|
||||
|
||||
// We are already done, let's continue our heavy-lifting work in the background (if we run off FastCGI)
|
||||
if (function_exists('fastcgi_finish_request')) {
|
||||
@fastcgi_finish_request();
|
||||
}
|
||||
buildIndex();
|
||||
|
||||
// We are already done and post is visible to others, let's continue our heavy-lifting work in the background (if we run off FastCGI)
|
||||
if (function_exists('fastcgi_finish_request')) {
|
||||
@fastcgi_finish_request();
|
||||
}
|
||||
|
||||
if ($post['op']) {
|
||||
rebuildThemes('post-thread', $board['uri']);
|
||||
|
||||
} else {
|
||||
event('post-after', $post);
|
||||
|
||||
// We are already done and post is visible to others, let's continue our heavy-lifting work in the background (if we run off FastCGI)
|
||||
if (function_exists('fastcgi_finish_request')) {
|
||||
@fastcgi_finish_request();
|
||||
}
|
||||
|
||||
buildIndex();
|
||||
|
||||
rebuildThemes('post', $board['uri']);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue