Skip to content

Commit

Permalink
fix(entities-plugins): add timeout to plugin update calls (#1464)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leopoldthecoder committed Jun 25, 2024
1 parent 60d3d01 commit 1f6c337
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -566,8 +566,10 @@ const confirmSwitchEnablement = async () => {
try {
const { data } = props.config?.app === 'konnect'
? await axiosInstance.put(url, { ...switchEnablementTarget.value, enabled })
: await axiosInstance.patch(url, { ...switchEnablementTarget.value, enabled })
// TODO: add timeout because when the plugin configuration is too big, the request can take very long.
// Remove timeout when the request is optimized. KM-267
? await axiosInstance.put(url, { ...switchEnablementTarget.value, enabled }, { timeout: 120000 })
: await axiosInstance.patch(url, { ...switchEnablementTarget.value, enabled }, { timeout: 120000 })
// Emit the success event for the host app
emit('toggle-enabled', enabled, data)
} catch (e: any) {
Expand Down

0 comments on commit 1f6c337

Please sign in to comment.