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:
parent
a517f31a9f
commit
332066e3dc
2 changed files with 3 additions and 1 deletions
|
@ -88,6 +88,7 @@ namespace {
|
||||||
parSettings.add_default("highlight_css", "sh_darkness.css");
|
parSettings.add_default("highlight_css", "sh_darkness.css");
|
||||||
parSettings.add_default("max_post_size", "1048576");
|
parSettings.add_default("max_post_size", "1048576");
|
||||||
parSettings.add_default("max_token_length", "10");
|
parSettings.add_default("max_token_length", "10");
|
||||||
|
parSettings.add_default("cache_highlighted", "true");
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_buildtime_info() {
|
void print_buildtime_info() {
|
||||||
|
|
|
@ -191,6 +191,7 @@ namespace kamokan {
|
||||||
Storage::SubmissionResult submission_res = storage.submit_pastie(parText, parExpiry, parLang, parSelfDestruct, remote_ip);
|
Storage::SubmissionResult submission_res = storage.submit_pastie(parText, parExpiry, parLang, parSelfDestruct, remote_ip);
|
||||||
|
|
||||||
if (not submission_res.error) {
|
if (not submission_res.error) {
|
||||||
|
if (settings().as<bool>("cache_highlighted"))
|
||||||
store_highlighted_pastie_async(submission_res.token, parText, parLang);
|
store_highlighted_pastie_async(submission_res.token, parText, parLang);
|
||||||
|
|
||||||
return std::make_pair(boost::make_optional(std::move(submission_res.token)), tawashi::HttpHeader());
|
return std::make_pair(boost::make_optional(std::move(submission_res.token)), tawashi::HttpHeader());
|
||||||
|
|
Loading…
Reference in a new issue