Skip to content

Commit 2af5aa0

Browse files
committed
Invalidate cache when performing additional post operations
1 parent 2cf739b commit 2af5aa0

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

qa-include/app/post-create.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
require_once QA_INCLUDE_DIR . 'db/points.php';
3030
require_once QA_INCLUDE_DIR . 'db/hotness.php';
3131
require_once QA_INCLUDE_DIR . 'util/string.php';
32+
require_once QA_INCLUDE_DIR . 'app/post-update.php';
3233

3334

3435
/**
@@ -225,6 +226,8 @@ function qa_answer_create($userid, $handle, $cookieid, $content, $format, $text,
225226
qa_db_points_update_ifuser($userid, 'aposts');
226227
}
227228

229+
qa_question_uncache($question['postid']);
230+
228231
qa_report_event($queued ? 'a_queue' : 'a_post', $userid, $handle, $cookieid, array(
229232
'postid' => $postid,
230233
'parentid' => $question['postid'],
@@ -313,6 +316,8 @@ function qa_comment_create($userid, $handle, $cookieid, $content, $format, $text
313316
$thread[] = $comment;
314317
}
315318

319+
qa_question_uncache($question['postid']);
320+
316321
qa_report_event($queued ? 'c_queue' : 'c_post', $userid, $handle, $cookieid, array(
317322
'postid' => $postid,
318323
'parentid' => $parent['postid'],

qa-include/app/post-update.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ function qa_question_set_content($oldquestion, $title, $content, $format, $text,
111111
}
112112
}
113113

114+
qa_question_uncache($oldquestion['postid']);
115+
114116
$eventparams = array(
115117
'postid' => $oldquestion['postid'],
116118
'title' => $title,
@@ -684,6 +686,8 @@ function qa_answer_set_content($oldanswer, $content, $format, $text, $notify, $u
684686
qa_post_index($oldanswer['postid'], 'A', $question['postid'], $oldanswer['parentid'], null, $content, $format, $text, null, $oldanswer['categoryid']);
685687
}
686688

689+
qa_question_uncache($question['postid']);
690+
687691
$eventparams = array(
688692
'postid' => $oldanswer['postid'],
689693
'parentid' => $oldanswer['parentid'],
@@ -973,6 +977,8 @@ function qa_comment_set_content($oldcomment, $content, $format, $text, $notify,
973977
qa_post_index($oldcomment['postid'], 'C', $question['postid'], $oldcomment['parentid'], null, $content, $format, $text, null, $oldcomment['categoryid']);
974978
}
975979

980+
qa_question_uncache($question['postid']);
981+
976982
$eventparams = array(
977983
'postid' => $oldcomment['postid'],
978984
'parentid' => $oldcomment['parentid'],

0 commit comments

Comments
 (0)