* [pbs-devel] [PATCH proxmox-backup 1/2] fix: ui: sync job: switch rate limit based on sync direction
@ 2025-03-10 17:01 Christian Ebner
2025-03-10 17:01 ` [pbs-devel] [PATCH proxmox-backup 2/2] docs: mention how to set the push sync jobs rate limit Christian Ebner
0 siblings, 1 reply; 2+ messages in thread
From: Christian Ebner @ 2025-03-10 17:01 UTC (permalink / raw)
To: pbs-devel
Commit 9aa213b8 ("config: sync: use same config section type `sync`
for push and pull") adapted the sync job edit so jobs in both, push
and pull can be edited using the same window. This however did not
include the switching of the direction to which the http client rate
limit is applied to.
Fix this by renaming the field to `rate-limit` and conditionally
settings the values to `rate-in` or `rate-out`.
Reported in the community forum:
https://forum.proxmox.com/threads/163414/
Fixes: 9aa213b8 ("config: sync: use same config section type `sync` for push and pull")
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
www/window/SyncJobEdit.js | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/www/window/SyncJobEdit.js b/www/window/SyncJobEdit.js
index bcd2f2fb2..f980a2efd 100644
--- a/www/window/SyncJobEdit.js
+++ b/www/window/SyncJobEdit.js
@@ -86,6 +86,13 @@ Ext.define('PBS.window.SyncJobEdit', {
} else {
values.location = 'remote';
}
+ if (values['rate-out'] && me.syncDirection === 'push') {
+ values['rate-limit'] = values['rate-out'];
+ delete values['rate-out'];
+ } else if (values['rate-in']) {
+ values['rate-limit'] = values['rate-in'];
+ delete values['rate-in'];
+ }
me.callParent([values]);
},
@@ -103,8 +110,15 @@ Ext.define('PBS.window.SyncJobEdit', {
if (!values.id && me.up('pbsSyncJobEdit').isCreate) {
values.id = 's-' + Ext.data.identifier.Uuid.Global.generate().slice(0, 13);
}
+ if (values['rate-limit'] && me.syncDirection === 'push') {
+ values['rate-out'] = values['rate-limit'];
+ } else {
+ values['rate-in'] = values['rate-limit'];
+ }
+ delete values['rate-limit'];
if (!me.isCreate) {
PBS.Utils.delete_if_default(values, 'rate-in');
+ PBS.Utils.delete_if_default(values, 'rate-out');
PBS.Utils.delete_if_default(values, 'remote');
if (typeof values.delete === 'string') {
values.delete = values.delete.split(',');
@@ -185,7 +199,7 @@ Ext.define('PBS.window.SyncJobEdit', {
},
{
xtype: 'pmxBandwidthField',
- name: 'rate-in',
+ name: 'rate-limit',
fieldLabel: gettext('Rate Limit'),
emptyText: gettext('Unlimited'),
submitAutoScaledSizeUnit: true,
@@ -221,7 +235,7 @@ Ext.define('PBS.window.SyncJobEdit', {
let me = this;
let form = me.up('pbsSyncJobEdit');
let nsField = form.down('field[name=remote-ns]');
- let rateLimitField = form.down('field[name=rate-in]');
+ let rateLimitField = form.down('field[name=rate-limit]');
let remoteField = form.down('field[name=remote]');
let storeField = form.down('field[name=remote-store]');
@@ -263,7 +277,7 @@ Ext.define('PBS.window.SyncJobEdit', {
let me = this;
let remoteStoreField = me.up('pbsSyncJobEdit').down('field[name=remote-store]');
remoteStoreField.setRemote(value);
- let rateLimitField = me.up('pbsSyncJobEdit').down('field[name=rate-in]');
+ let rateLimitField = me.up('pbsSyncJobEdit').down('field[name=rate-limit]');
rateLimitField.setDisabled(!value);
if (!value) {
rateLimitField.setValue(null);
--
2.39.5
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pbs-devel] [PATCH proxmox-backup 2/2] docs: mention how to set the push sync jobs rate limit
2025-03-10 17:01 [pbs-devel] [PATCH proxmox-backup 1/2] fix: ui: sync job: switch rate limit based on sync direction Christian Ebner
@ 2025-03-10 17:01 ` Christian Ebner
0 siblings, 0 replies; 2+ messages in thread
From: Christian Ebner @ 2025-03-10 17:01 UTC (permalink / raw)
To: pbs-devel
Explicitly mention how to set the rate limit for sync jobs in push
direction to avoid possible confusion.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
docs/managing-remotes.rst | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/docs/managing-remotes.rst b/docs/managing-remotes.rst
index f8012636e..a784fcc00 100644
--- a/docs/managing-remotes.rst
+++ b/docs/managing-remotes.rst
@@ -227,13 +227,16 @@ Bandwidth Limit
Syncing a datastore to an archive can produce a lot of traffic and impact other
users of the network. In order to avoid network or storage congestion, you can
-limit the bandwidth of the sync job by setting the ``rate-in`` option either in
-the web interface or using the ``proxmox-backup-manager`` command-line tool:
+limit the bandwidth of a sync job in pull direction by setting the ``rate-in``
+option either in the web interface or using the ``proxmox-backup-manager``
+command-line tool:
.. code-block:: console
# proxmox-backup-manager sync-job update ID --rate-in 20MiB
+For sync jobs in push direction use the ``rate-out`` option instead.
+
Sync Direction Push
^^^^^^^^^^^^^^^^^^^
--
2.39.5
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-03-10 17:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-10 17:01 [pbs-devel] [PATCH proxmox-backup 1/2] fix: ui: sync job: switch rate limit based on sync direction Christian Ebner
2025-03-10 17:01 ` [pbs-devel] [PATCH proxmox-backup 2/2] docs: mention how to set the push sync jobs rate limit Christian Ebner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal