@forge/tunnel

7.1.2-next.3-experimental-e9e08bb7.1.2-next.4
out/command/start-tunnel-command.js
~out/command/start-tunnel-command.jsModified
+6−9
Index: package/out/command/start-tunnel-command.js
===================================================================
--- package/out/command/start-tunnel-command.js
+++ package/out/command/start-tunnel-command.js
@@ -52,18 +52,17 @@
         if (port < 1 || port > 65535) {
             throw new InvalidTunnelConfigError(cli_shared_1.Text.tunnel.error.invalidSelfManagedTunnelPort(port.toString()));
         }
     }
-    stopServices = async (appId, environmentKey, containersDockerComposeFiles, additionalCleanup) => {
+    stopServices = async (appId, environmentKey, containersDockerComposeFiles) => {
         await Promise.all([
             this.functionHost.stopWatching(),
             this.tunnelClient.unregisterTunnels(appId, environmentKey),
             this.tunnelFactory.closeTunnel(),
             this.devServer.stop(),
             ...Object.values(this.tunnelServers).map((server) => server.stop()),
             this.cspReporterServer?.stop(),
-            (0, cli_shared_1.stopDockerComposeStack)(this.configFile, this.logger, containersDockerComposeFiles),
-            additionalCleanup?.()
+            (0, cli_shared_1.stopDockerComposeStack)(this.configFile, this.logger, containersDockerComposeFiles)
         ]);
     };
     startFaaSTunnelServer = async ({ port, appId, environmentKey, tunnelUrl }) => {
         const { permissions = {}, remotes = [] } = await this.configFile.readConfig();
@@ -109,16 +108,14 @@
             });
             return this.tunnelServers[key].start();
         }));
     };
-    async execute(options, containersDockerComposeFiles, additionalCleanup) {
+    async execute(options, containersDockerComposeFiles) {
         const { id: appId } = await this.getAppConfig();
         const { port, environmentKey, url } = options;
         this.validateTunnelUrl(url);
         this.validateTunnelPort(port);
         const allResources = await this.configFile.getResources();
-        let cleanupPromise;
-        const additionalCleanupOnce = additionalCleanup ? () => (cleanupPromise ??= additionalCleanup()) : undefined;
         try {
             const faasTunnelServer = await this.startFaaSTunnelServer({
                 port,
                 appId,
@@ -133,11 +130,11 @@
                     resourceKey
                 }))
             };
             await this.tunnelClient.registerTunnels(appId, environmentKey, tunnelDefinitions);
-            const stopFunction = async () => this.stopServices(appId, environmentKey, containersDockerComposeFiles, additionalCleanupOnce);
+            const stopFunction = async () => this.stopServices(appId, environmentKey, containersDockerComposeFiles);
             this.devServer.setErrorHandler?.(async (error) => {
-                await this.stopServices(appId, environmentKey, containersDockerComposeFiles, additionalCleanupOnce);
+                await this.stopServices(appId, environmentKey, containersDockerComposeFiles);
                 await (0, cli_shared_1.exitOnError)(this.logger, error);
             });
             const reloadSandboxes = async (bundledCode, tunnelOptions) => {
                 await this.functionHost.stopWatching();
@@ -153,9 +150,9 @@
             };
         }
         catch (e) {
             try {
-                await this.stopServices(appId, environmentKey, containersDockerComposeFiles, additionalCleanupOnce);
+                await this.stopServices(appId, environmentKey, containersDockerComposeFiles);
             }
             catch { }
             throw e;
         }