Browse Source

added finally condition to end program no matter what

Pablo Barrera Yaksic 7 months ago
parent
commit
b26a07d52b
2 changed files with 4 additions and 4 deletions
  1. 1 1
      package.json
  2. 3 3
      src/index.ts

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "bot-noticias",
   "name": "bot-noticias",
-  "version": "0.0.4",
+  "version": "0.0.5",
   "description": "Bot que busca noticias y las replica en mastodon.cl",
   "description": "Bot que busca noticias y las replica en mastodon.cl",
   "main": "dist/index.js",
   "main": "dist/index.js",
   "scripts": {
   "scripts": {

+ 3 - 3
src/index.ts

@@ -30,9 +30,9 @@ async function main (): Promise<void> {
 }
 }
 
 
 main()
 main()
-  .then(() => {
-    process.exit(0);
-  })
   .catch((err) => {
   .catch((err) => {
     console.error(err)
     console.error(err)
+  })
+  .finally(() => {
+    process.exit(0);
   });
   });