]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
reduce syslog api calls
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 30 Apr 2019 13:03:35 +0000 (15:03 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 30 Apr 2019 13:28:00 +0000 (13:28 +0000)
do not poll the syslog api call multiple times simultaneously,
since it can be very costly, depending on the journal size

with this, there is always only one per client

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
panel/LogView.js

index fe8d274f4a6f0559a092ba24b7171eb5ee0584c7..aae7440f586cd88f3d6a24bf17e0a986e8a40d9e 100644 (file)
@@ -73,6 +73,7 @@ Ext.define('Proxmox.panel.LogView', {
 
        doLoad: function() {
            var me = this;
+           me.running = true;
            var view = me.getView();
            var viewModel = me.getViewModel();
            Proxmox.Utils.API2Request({
@@ -94,6 +95,7 @@ Ext.define('Proxmox.panel.LogView', {
 
                    lines.length = total;
                    me.updateView(lines.join('<br>'), first - 1, total);
+                   me.running = false;
                },
                failure: function(response) {
                    if (view.failCallback) {
@@ -102,6 +104,7 @@ Ext.define('Proxmox.panel.LogView', {
                        var msg = response.htmlStatus;
                        Proxmox.Utils.setErrorMask(me, msg);
                    }
+                   me.running = false;
                }
            });
        },
@@ -153,7 +156,9 @@ Ext.define('Proxmox.panel.LogView', {
                    }
 
                    if (me.scrollPosBottom() <= 1) {
-                       view.loadTask.delay(200);
+                       if (!me.running) {
+                           view.loadTask.delay(200);
+                       }
                    }
                },
                interval: 1000