Skip to content

Commit

Permalink
fetch: Minor tweaks to logging
Browse files Browse the repository at this point in the history
  • Loading branch information
BastianBlokland committed Feb 2, 2025
1 parent 33f5f43 commit 731a547
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions apps/utilities/fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static void fetch_config_destroy(FetchConfig* cfg) {
data_destroy(g_dataReg, g_allocHeap, g_fetchConfigMeta, mem_create(cfg, sizeof(FetchConfig)));
}

static u32 fetch_config_max_origin_assets(FetchConfig* cfg) {
static u32 fetch_config_max_origin_assets(const FetchConfig* cfg) {
u32 res = 0;
heap_array_for_t(cfg->origins, FetchOrigin, origin) {
res = math_max(res, (u32)origin->assets.count);
Expand Down Expand Up @@ -371,12 +371,17 @@ static i32 fetch_run_origin(
return retCode;
}

static i32
fetch_run(FetchConfig* cfg, FetchRegistry* reg, const FetchFlags flags, const String outPath) {
static i32 fetch_run(
const FetchConfig* cfg, FetchRegistry* reg, const FetchFlags flags, const String outPath) {
i32 retCode = 0;
NetRest* rest = null;
const TimeSteady timeStart = time_steady_clock();

log_i(
"Fetching assets",
log_param("origins", fmt_int(cfg->origins.count)),
log_param("output-path", fmt_path(outPath)));

const u32 maxRequests = fetch_config_max_origin_assets(cfg);
if (maxRequests) {
rest = net_rest_create(g_allocHeap, fetch_worker_count, maxRequests, fetch_http_flags());
Expand Down

0 comments on commit 731a547

Please sign in to comment.