Merge pull request #221 into master
2f293edcontainer: lib_taxes: run linter (Aaron Fiore)66c34a4container: lib_taxes: optimize writes by forking (Aaron Fiore)bf3a4e3container: lib_reports: optimize writes by forking (Aaron Fiore)
This commit was merged in pull request #221.
This commit is contained in:
@@ -342,12 +342,13 @@ function lib_reports::__reports()
|
||||
|
||||
lib_utils::print_custom " \e[32m├─\e[34m\e[1;3m ${_new_echo}\e[0m\n"
|
||||
|
||||
lib_reports::__reports_write \
|
||||
(lib_reports::__reports_write \
|
||||
"$_type" \
|
||||
"$_new_desc" \
|
||||
"$_new_base_file" \
|
||||
"${_new_opts[@]}"
|
||||
"${_new_opts[@]}") &
|
||||
done
|
||||
wait
|
||||
lib_utils::print_custom " \e[32m│\e[0m\n"
|
||||
done
|
||||
|
||||
|
||||
@@ -1036,18 +1036,21 @@ function lib_taxes::__taxes_write()
|
||||
# Generate transparent (full) reports
|
||||
local _ext_full="report_full.csv"
|
||||
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 _out_file="${_base_path}-${_ext_full}"
|
||||
local _base_path="${_tax_root_dir}/${_arg_tag}/${_tax_year}_${_arg_tag}"
|
||||
local _out_file="${_base_path}-${_ext_full}"
|
||||
|
||||
lib_taxes::__taxes_print "$_tax_year" "$_arg_tag" >"${_out_file}"
|
||||
lib_utils::catch $?
|
||||
lib_taxes::__taxes_print "$_tax_year" "$_arg_tag" >"${_out_file}"
|
||||
lib_utils::catch $?
|
||||
|
||||
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})"
|
||||
fi
|
||||
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})"
|
||||
fi
|
||||
) &
|
||||
done
|
||||
wait
|
||||
|
||||
# Patch transparent (full) reports
|
||||
# WARNING: depends on previous base path / extension format # TODO: no, not this way
|
||||
|
||||
Reference in New Issue
Block a user