From: Dominik Csapak <d.csapak@proxmox.com>
To: Stefan Hanreich <s.hanreich@proxmox.com>,
Proxmox Datacenter Manager development discussion
<pdm-devel@lists.proxmox.com>
Subject: Re: [pdm-devel] [PATCH datacenter-manager v3 1/8] server: task cache: treat a limit of 0 as unbounded
Date: Mon, 25 Aug 2025 12:49:54 +0200 [thread overview]
Message-ID: <50c18248-b735-4cb0-a2dd-aab461372108@proxmox.com> (raw)
In-Reply-To: <5636a6b0-c11f-49fc-92d2-9a6b3829b2dc@proxmox.com>
On 8/25/25 11:55 AM, Stefan Hanreich wrote:
>
>
> On 8/25/25 10:10 AM, Dominik Csapak wrote:
>> like we do in our other products e.g. like PBS
>> This way, one can specify a way to return *all* tasks.
>>
>> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
>> ---
>> server/src/remote_tasks/mod.rs | 7 ++++++-
>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/server/src/remote_tasks/mod.rs b/server/src/remote_tasks/mod.rs
>> index 63a279a..91b79c1 100644
>> --- a/server/src/remote_tasks/mod.rs
>> +++ b/server/src/remote_tasks/mod.rs
>> @@ -36,6 +36,11 @@ pub async fn get_tasks(filters: TaskFilters) -> Result<Vec<TaskListItem>, Error>
>> GetTasks::All
>> };
>>
>> + let limit = match filters.limit {
>> + 0 => usize::MAX,
>> + limit => limit as usize,
>> + };
>> +
>
> is this a usize because of backwards / API compatibility? Otherwise,
> wouldn't an Option be preferrable?
>
i think for the taskfilters it's desireable to have a somehwat sane
default limit in the api (which is currently '50') and make the
'show all tasks' an explicit case, otherwise people rather easily
get all tasks returned, and that can be many
but IMHO this is not set in stone, if we want to return all tasks
by default we could change it of course
since we reuse the `TaskFilters` struct this would also affect the pdm
node tasks themselves.
>> let returned_tasks = cache
>> .get_tasks(which)?
>> .filter_map(|task| {
>> @@ -105,7 +110,7 @@ pub async fn get_tasks(filters: TaskFilters) -> Result<Vec<TaskListItem>, Error>
>> true
>> })
>> .skip(filters.start as usize)
>> - .take(filters.limit as usize)
>> + .take(limit)
>> .collect();
>>
>> Ok(returned_tasks)
>
>
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
next prev parent reply other threads:[~2025-08-25 10:50 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-25 8:08 [pdm-devel] [PATCH datacenter-manager v3 0/8] add task summary panels in dashboard Dominik Csapak
2025-08-25 8:08 ` [pdm-devel] [PATCH datacenter-manager v3 1/8] server: task cache: treat a limit of 0 as unbounded Dominik Csapak
2025-08-25 9:55 ` Stefan Hanreich
2025-08-25 10:49 ` Dominik Csapak [this message]
2025-08-25 13:40 ` Stefan Hanreich
2025-08-25 8:08 ` [pdm-devel] [PATCH datacenter-manager v3 2/8] server: api: remote tasks: add 'remote' filter option Dominik Csapak
2025-08-25 8:08 ` [pdm-devel] [PATCH datacenter-manager v3 3/8] server: api: add remote-tasks statistics Dominik Csapak
2025-08-25 8:08 ` [pdm-devel] [PATCH datacenter-manager v3 4/8] ui: refactor remote upid formatter Dominik Csapak
2025-08-25 10:56 ` Stefan Hanreich
2025-08-26 9:48 ` Dominik Csapak
2025-08-25 8:08 ` [pdm-devel] [PATCH datacenter-manager v3 5/8] ui: tasks: add helper to summarize task categories Dominik Csapak
2025-08-25 9:54 ` Stefan Hanreich
2025-08-25 8:08 ` [pdm-devel] [PATCH datacenter-manager v3 6/8] ui: add dialog to show filtered tasks Dominik Csapak
2025-08-25 8:08 ` [pdm-devel] [PATCH datacenter-manager v3 7/8] ui: dashboard: add task summaries Dominik Csapak
2025-08-25 10:52 ` Stefan Hanreich
2025-08-25 8:08 ` [pdm-devel] [PATCH datacenter-manager v3 8/8] ui: dashboard: make task summary time range configurable Dominik Csapak
2025-08-25 9:54 ` Stefan Hanreich
2025-08-25 13:17 ` [pdm-devel] [PATCH datacenter-manager v3 0/8] add task summary panels in dashboard Stefan Hanreich
2025-08-26 11:22 ` [pdm-devel] superseded: " Dominik Csapak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50c18248-b735-4cb0-a2dd-aab461372108@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pdm-devel@lists.proxmox.com \
--cc=s.hanreich@proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox