1
0
Fork 0
mirror of https://github.com/KingDuckZ/kamokan.git synced 2024-11-23 00:33:44 +00:00

Add a cache_highlighted setting to let users turn caching off.

This commit is contained in:
King_DuckZ 2017-08-08 10:13:16 +01:00
parent a517f31a9f
commit 332066e3dc
2 changed files with 3 additions and 1 deletions

View file

@ -88,6 +88,7 @@ namespace {
parSettings.add_default("highlight_css", "sh_darkness.css");
parSettings.add_default("max_post_size", "1048576");
parSettings.add_default("max_token_length", "10");
parSettings.add_default("cache_highlighted", "true");
}
void print_buildtime_info() {

View file

@ -191,7 +191,8 @@ namespace kamokan {
Storage::SubmissionResult submission_res = storage.submit_pastie(parText, parExpiry, parLang, parSelfDestruct, remote_ip);
if (not submission_res.error) {
store_highlighted_pastie_async(submission_res.token, parText, parLang);
if (settings().as<bool>("cache_highlighted"))
store_highlighted_pastie_async(submission_res.token, parText, parLang);
return std::make_pair(boost::make_optional(std::move(submission_res.token)), tawashi::HttpHeader());
}