container: lib_taxes: optimize writes by forking
- Decreases real time in multicore container environments. * Given the nature of the writer, there should be no race conditions.
This commit is contained in:
@@ -1036,6 +1036,7 @@ function lib_taxes::__taxes_write()
|
|||||||
# Generate transparent (full) reports
|
# Generate transparent (full) reports
|
||||||
local _ext_full="report_full.csv"
|
local _ext_full="report_full.csv"
|
||||||
for _arg_tag in "${global_arg_tag[@]}"; do
|
for _arg_tag in "${global_arg_tag[@]}"; do
|
||||||
|
(
|
||||||
lib_utils::print_custom " \e[32m├─\e[34m\e[1;3m ${_arg_tag} (full)\e[0m\n"
|
lib_utils::print_custom " \e[32m├─\e[34m\e[1;3m ${_arg_tag} (full)\e[0m\n"
|
||||||
|
|
||||||
local _base_path="${_tax_root_dir}/${_arg_tag}/${_tax_year}_${_arg_tag}"
|
local _base_path="${_tax_root_dir}/${_arg_tag}/${_tax_year}_${_arg_tag}"
|
||||||
@@ -1047,7 +1048,9 @@ function lib_taxes::__taxes_write()
|
|||||||
if [[ ! -f "$_out_file" || ! -s "$_out_file" ]]; then
|
if [[ ! -f "$_out_file" || ! -s "$_out_file" ]]; then
|
||||||
lib_utils::print_warning "Nothing generated for '${_arg_tag}' (no taxable event found for the year ${global_arg_year})"
|
lib_utils::print_warning "Nothing generated for '${_arg_tag}' (no taxable event found for the year ${global_arg_year})"
|
||||||
fi
|
fi
|
||||||
|
) &
|
||||||
done
|
done
|
||||||
|
wait
|
||||||
|
|
||||||
# Patch transparent (full) reports
|
# Patch transparent (full) reports
|
||||||
# WARNING: depends on previous base path / extension format # TODO: no, not this way
|
# WARNING: depends on previous base path / extension format # TODO: no, not this way
|
||||||
|
|||||||
Reference in New Issue
Block a user