------
* Fixed uninitialized struct fields bug leading to random errors.
-* Improved performance (keep track of the ddts older than 4 weeks).
+* perf: keep track of the ddts older than 4 weeks).
+* perf: sum ddts to compute total downloads instead of LP query.
v1.0.0
------
return ddts;
}
+
+int ddts_get_count(struct daily_download_total **ddts)
+{
+ struct daily_download_total **cur;
+ int i;
+
+ i = 0;
+ for (cur = ddts; *cur; cur++)
+ i += (*cur)->count;
+
+ return i;
+}
ddts_merge(struct daily_download_total **,
struct daily_download_total **);
+int ddts_get_count(struct daily_download_total **);
+
#endif
h->self_link);
continue;
}
- count = get_download_count(h->self_link);
- if (count == -1) {
- log_err(_("Failed to retrieve download count for %s"),
- h->self_link);
- count = 0;
- }
+ count = ddts_get_count(totals);
pkg_name = h->binary_package_name;
pkg_version = h->binary_package_version;
arch_series