Skip to content

Commit

Permalink
Ignore irrelevant container events
Browse files Browse the repository at this point in the history
These are internal transient states which don't need to reflect in the
UI. They happen quickly in bursts, with a "permanent state" event
following such as "create", "died", or "remove". This helps to reduce
the API calls and thus mitigates out-of-order results; see
containers/podman#19124
  • Loading branch information
martinpitt committed Jul 5, 2023
1 parent 7f6ab76 commit 6fe8769
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,20 @@ class Application extends React.Component {
switch (event.Action) {
/* The following events do not need to trigger any state updates */
case 'attach':
case 'checkpoint':
case 'cleanup':
case 'exec':
case 'exec_died':
case 'export':
case 'import':
case 'init':
case 'kill':
case 'mount':
case 'prune':
case 'restart':
case 'restore':
case 'sync':
case 'unmount':
case 'wait':
break;
/* The following events need only to update the Container list
Expand All @@ -393,20 +403,10 @@ class Application extends React.Component {
: this.updatePods(system)
).then(() => this.updateContainer(id, system, event));
break;
case 'checkpoint':
case 'create':
case 'died':
case 'exec_died':
case 'kill':
case 'cleanup':
case 'mount':
case 'pause':
case 'prune':
case 'restart':
case 'restore':
case 'stop':
case 'sync':
case 'unmount':
case 'unpause':
case 'rename': // rename event is available starting podman v4.1; until then the container does not get refreshed after renaming
this.updateContainer(id, system, event);
Expand Down

0 comments on commit 6fe8769

Please sign in to comment.