gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated (5f7926db8 -> 0dbb4ddd2)


From: gnunet
Subject: [taler-wallet-core] branch master updated (5f7926db8 -> 0dbb4ddd2)
Date: Mon, 22 Apr 2024 19:56:10 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a change to branch master
in repository wallet-core.

    from 5f7926db8 wallet-core: support multi-batch p2p payments
     new cd0d58753 taler-wallet-cli: better default socket location
     new 0dbb4ddd2 taler-wallet-cli: clean up socket

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 packages/taler-wallet-cli/src/index.ts | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/packages/taler-wallet-cli/src/index.ts 
b/packages/taler-wallet-cli/src/index.ts
index 134631698..59be964b2 100644
--- a/packages/taler-wallet-cli/src/index.ts
+++ b/packages/taler-wallet-cli/src/index.ts
@@ -90,6 +90,7 @@ setUnhandledRejectionHandler((error: any) => {
 });
 
 const defaultWalletDbPath = pathHomedir() + "/" + ".talerwalletdb.sqlite3";
+const defaultWalletCoreSocket = pathHomedir() + "/" + ".wallet-core.sock";
 
 function assertUnreachable(x: never): never {
   throw new Error("Didn't expect to get here");
@@ -1203,13 +1204,32 @@ advancedCli
     help: "Serve the wallet API via a unix domain socket.",
   })
   .requiredOption("unixPath", ["--unix-path"], clk.STRING, {
-    default: "wallet-core.sock",
+    default: defaultWalletCoreSocket,
   })
   .flag("noInit", ["--no-init"], {
     help: "Do not initialize the wallet. The client must send the initWallet 
message.",
   })
   .action(async (args) => {
-    logger.info(`serving at ${args.serve.unixPath}`);
+    const socketPath = args.serve.unixPath;
+    logger.info(`serving at ${socketPath}`);
+    let cleanupCalled = false;
+
+    const cleanupSocket = (signal: string, code: number) => {
+      if (cleanupCalled) {
+        return;
+      }
+      cleanupCalled = true;
+      try {
+        logger.info("cleaning up socket");
+        fs.unlinkSync(socketPath);
+      } catch (e) {
+        logger.warn(`unable to clean up socket: ${e}`);
+      }
+      process.exit(128 + code);
+    };
+    process.on("SIGTERM", cleanupSocket);
+    process.on("SIGINT", cleanupSocket);
+
     const onNotif = (notif: WalletNotification) => {
       if (observabilityEventFile) {
         switch (notif.type) {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]