From: Dominik Csapak <d.csapak@proxmox.com>
To: yew-devel@lists.proxmox.com
Subject: [yew-devel] [PATCH yew-comp 2/4] http helpers: expose ticket refresh loop controls
Date: Tue, 1 Jul 2025 10:38:57 +0200 [thread overview]
Message-ID: <20250701083859.2088138-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20250701083859.2088138-1-d.csapak@proxmox.com>
by introducing a stop_ticket_refresh_loop and making both start and stop
public. This can be useful e.g. when such a ticket refresh loop is
unwanted. This is the case for example for the PMG quarantine interface
when using a PMGQUAR ticket, since that is valid as long as the
quarantine is valid and refreshing it simply yields the same ticket.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/http_helpers.rs | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/http_helpers.rs b/src/http_helpers.rs
index d035b48..94cc078 100644
--- a/src/http_helpers.rs
+++ b/src/http_helpers.rs
@@ -85,13 +85,17 @@ thread_local! {
static TICKET_REFRESH_LOOP_GUARD: RefCell<Option<AsyncAbortGuard>> = const { RefCell::new(None) };
}
-fn start_ticket_refresh_loop() {
+pub fn start_ticket_refresh_loop() {
let abort_guard = AsyncAbortGuard::spawn(ticket_refresh_loop());
// Make sure there is a single loop running.
TICKET_REFRESH_LOOP_GUARD.with_borrow_mut(|v| *v = Some(abort_guard));
}
+pub fn stop_ticket_refresh_loop() {
+ TICKET_REFRESH_LOOP_GUARD.with_borrow_mut(|v| *v = None);
+}
+
async fn ticket_refresh_loop() {
loop {
let sleep_time_ms = 5000;
--
2.39.5
_______________________________________________
yew-devel mailing list
yew-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/yew-devel
next prev parent reply other threads:[~2025-07-01 8:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-01 8:38 [yew-devel] [PATCH yew-comp 1/4] expose subscription_note publicly Dominik Csapak
2025-07-01 8:38 ` Dominik Csapak [this message]
2025-07-01 8:38 ` [yew-devel] [PATCH yew-comp 3/4] login panel/realm selector: make realm path configurable Dominik Csapak
2025-07-01 8:38 ` [yew-devel] [PATCH yew-comp 4/4] login panel: use snackbar for errors when on mobile Dominik Csapak
2025-07-01 9:25 ` [yew-devel] applied: [PATCH yew-comp 1/4] expose subscription_note publicly Dietmar Maurer
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=20250701083859.2088138-2-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=yew-devel@lists.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.