[gnome-software: 1/2] gs-plugin-job: Only report the timeout when it is actually enforced
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software: 1/2] gs-plugin-job: Only report the timeout when it is actually enforced
- Date: Fri, 10 Jun 2022 12:09:10 +0000 (UTC)
commit 6d200d4445e375171509e85a68a03c319a5338fb
Author: Pablo Correa Gómez <ablocorrea hotmail com>
Date: Fri Jun 10 12:38:06 2022 +0200
gs-plugin-job: Only report the timeout when it is actually enforced
Most actions do not enforce a timeout. Reporting a timeout when it
is not enforced is confusing, leading to reports that a certain
action started with a certain timeout when that is not true or that
it completed well-passed its timeout.
lib/gs-plugin-job.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/lib/gs-plugin-job.c b/lib/gs-plugin-job.c
index ae7b44e6f..5af0813a4 100644
--- a/lib/gs-plugin-job.c
+++ b/lib/gs-plugin-job.c
@@ -75,7 +75,16 @@ gs_plugin_job_to_string (GsPluginJob *self)
if (priv->propagate_error)
g_string_append_printf (str, " with propagate-error=True");
if (priv->timeout > 0)
- g_string_append_printf (str, " with timeout=%u", priv->timeout);
+ switch (priv->action) {
+ case GS_PLUGIN_ACTION_GET_ALTERNATES:
+ case GS_PLUGIN_ACTION_SEARCH:
+ case GS_PLUGIN_ACTION_SEARCH_PROVIDES:
+ g_string_append_printf (str, " with timeout=%u", priv->timeout);
+ break;
+ default:
+ break;
+ }
+
if (priv->max_results > 0)
g_string_append_printf (str, " with max-results=%u", priv->max_results);
if (priv->search != NULL) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]