Cleaning up stale applications in Application Engine

When you are creating or editing your business application in the low-code designer, you might preview your application. When you preview you application, it's published to the Application Engine. Over time, these published applications can start to add up. There are two ways to clean up stale applications in the Application Engine. You can rely on a scheduled job to periodically delete the applications, or you can use REST API calls.

Deleting stale applications in Application Engine does not delete your application from Business applications. Deleting the application frees up resources on the Application Engine. When you preview your application again when editing your application in the low-code designer, your application is republished to the Application Engine that is used by the low-code designer.

Scheduled job

The scheduled job periodically deletes stale applications in the Application Engine based on the following settings.

bastudio_configuration:
playback_server:
env:
purge_stale_apps_interval:  Interval for the purging job to run.  Default is 86400000 ms.
apps_threshold:  Minimum number of existing applications for job to start purging applications.  Default is 100 applications.
stale_threshold:  Age of the applications to be considered as stale.  Default is 172800000 ms.

REST API

In some scenarios, you might need to manually start application deletion. You can use a REST API call to delete stale applications if your user ID is a member of the administrator group.

Call the REST API PUT https://DesignerAppEngineHost:DesignerAppEnginePort/v1/applications/purgeStaleApps

The following examples illustrate how to use the REST API to delete stale applications:
Note: The threshold is in milliseconds.
  • Delete stale applications by using setting the custom resource definition that you configured during installation:
    PUT https://DesignerAppEngineHost:DesignerAppEnginePort/v1/applications/purgeStaleApps
  • Delete all applications:
    PUT https://DesignerAppEngineHost:DesignerAppEnginePort/v1/applications/purgeStaleApps?appsThreshold=0&staleThreshold=0
  • Delete stale applications when the number of applications is over 50 by using the staleThreshold that you configured during installation:
    PUT https://DesignerAppEngineHost:DesignerAppEnginePort/v1/applications/purgeStaleApps?appsThreshold=50
  • Delete stale applications that were published over an hour ago by using appsThreshold that you configured during installation:
    PUT https://DesignerAppEngineHost:DesignerAppEnginePort/v1/applications/purgeStaleApps?staleThreshold=3600000
  • Purge stale applications that were published over an hour ago and when the number of applications is over 50:
    PUT https://DesignerAppEngineHost:DesignerAppEnginePort/v1/applications/purgeStaleApps?appsThreshold=50&staleThreshold=3600000