You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using the serverless-cloudflare-workers plugin and have been deploying our functions to Cloudflare successfully for some time now. Given that the non enterprise accounts, provided the possibility to deploy just to the one worker, we never considered using the Remove functionality provided by this plugin. However, that changed recently when you announced multi script support for all customer (not only Enterprise). Since we wanted to take advantage of this, our CI/CD pipeline was updated to make use of the Serverless remove command, however on doing so, our multi script worker deployments and the respective routes were not being removed.
After numerous hours of debugging it looks like the issue is related to the process of triggering the promise from within the Remove constructor which was not being returned... so the process was exiting since serverless was not then aware that there are additional steps to execute.
diff --git a/node_modules/serverless-cloudflare-workers/remove/cloudflareRemove.js b/node_modules/serverless-cloudflare-workers/remove/cloudflareRemove.js
index 6db2fa8..b1b8e06 100644
--- a/node_modules/serverless-cloudflare-workers/remove/cloudflareRemove.js
+++ b/node_modules/serverless-cloudflare-workers/remove/cloudflareRemove.js
@@ -35,7 +35,7 @@ class CloudflareRemove {
if (this.options.function || this.options.f) {
throw new Error("This does not support -f yet.")
}
- BB.bind(this)
+ return BB.bind(this)
.then(this.remove)
.then(resp => console.log("Removed"))
}
@@ -50,7 +50,11 @@ class CloudflareRemove {
} = this.provider.config;
const functionKeys = this.serverless.service.getAllFunctions();
- const multiscriptEnabled = await this.checkAccountType();
+
+ // Cloudflare enabled multiscripts for everyone. No need to check anything
+ // const multiscriptEnabled = await this.checkAccountType();
+ const multiscriptEnabled = true;
+
The above patch is relatively crude but ensure that the remove process does indeed work
The text was updated successfully, but these errors were encountered:
dietkinnie
changed the title
Removal not working due to constructure promis not being returned and the now default multiscript support
Removal not working due to construct promis not being returned and the now default multiscript support
Jun 10, 2019
dietkinnie
changed the title
Removal not working due to construct promis not being returned and the now default multiscript support
Removal not working due to construct promise not being returned and the now default multiscript support
Jun 10, 2019
dietkinnie
changed the title
Removal not working due to construct promise not being returned and the now default multiscript support
Removal not working due to constructor promise not being returned and the now default multiscript support
Jun 10, 2019
We are using the serverless-cloudflare-workers plugin and have been deploying our functions to Cloudflare successfully for some time now. Given that the non enterprise accounts, provided the possibility to deploy just to the one worker, we never considered using the Remove functionality provided by this plugin. However, that changed recently when you announced multi script support for all customer (not only Enterprise). Since we wanted to take advantage of this, our CI/CD pipeline was updated to make use of the Serverless remove command, however on doing so, our multi script worker deployments and the respective routes were not being removed.
After numerous hours of debugging it looks like the issue is related to the process of triggering the promise from within the Remove constructor which was not being returned... so the process was exiting since serverless was not then aware that there are additional steps to execute.
The above patch is relatively crude but ensure that the remove process does indeed work
The text was updated successfully, but these errors were encountered: