cleanup, error pages
This commit is contained in:
@@ -497,35 +497,6 @@ void compiler_record_compile_result(SharedUnit* su, f64 duration, bool success,
|
||||
}
|
||||
}
|
||||
|
||||
void compiler_begin_render_result(SharedUnit* su, bool count_request)
|
||||
{
|
||||
su->invoke_count += 1;
|
||||
if(count_request)
|
||||
su->request_count += 1;
|
||||
su->last_rendered = time();
|
||||
}
|
||||
|
||||
void compiler_record_render_result(SharedUnit* su, f64 duration, bool success, String error_status = "")
|
||||
{
|
||||
su->last_render_duration = duration;
|
||||
su->total_render_duration += duration;
|
||||
if(su->best_render_duration == 0 || duration < su->best_render_duration)
|
||||
su->best_render_duration = duration;
|
||||
if(duration > su->worst_render_duration)
|
||||
su->worst_render_duration = duration;
|
||||
|
||||
if(success)
|
||||
{
|
||||
su->runtime_error_status = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
su->runtime_error_count += 1;
|
||||
su->runtime_error_status = error_status;
|
||||
su->last_error = time();
|
||||
}
|
||||
}
|
||||
|
||||
String compiler_error_status(SharedUnit* su)
|
||||
{
|
||||
if(!su)
|
||||
@@ -591,24 +562,6 @@ void compiler_tree_set_bool(DValue& tree, String key, bool value)
|
||||
tree[key].set_bool(value);
|
||||
}
|
||||
|
||||
bool compiler_is_request_entry_unit(Request* context, SharedUnit* su)
|
||||
{
|
||||
if(!context || !su)
|
||||
return(false);
|
||||
auto request_file = compiler_normalize_unit_path(context, context->params["SCRIPT_FILENAME"]);
|
||||
return(request_file != "" && request_file == su->file_name);
|
||||
}
|
||||
|
||||
bool compiler_can_write_response(Request* context)
|
||||
{
|
||||
return(
|
||||
context &&
|
||||
context->params["REQUEST_METHOD"] != "" &&
|
||||
context->ob &&
|
||||
context->ob_stack.size() > 0
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
String preprocess_shared_unit(Request* context, SharedUnit* su)
|
||||
|
||||
Reference in New Issue
Block a user