nodex icon indicating copy to clipboard operation
nodex copied to clipboard

Terminate the proces with the ctrl + c signal

Open da13da opened this issue 3 months ago • 3 comments

Why

The process does not terminate with ctrl + c. Likely, this is because an interval of 3600 was specified, and it was waiting during that time.

What

By using tokio::select!:, we changed it so that it waits for signals from tick and ctrl_c at the same time, and proceeds from the one that is completed first.

Check

Ensure that receive and stop function without any issues

2024-03-19T21:15:15.658440+09:00 [INFO] - nodex_agent::handlers::receiver - stop receiver - src/handlers/receiver.rs:46
2024-03-19T21:15:50.778199+09:00 [INFO] - nodex_agent::controllers::public::nodex_receive - Receive message. message_id = "4cc6b394-751b-4e0c-b8c5-79d61adfafb0" - src/controllers/public/nodex_receive.rs:110
2024-03-19T21:15:50.873167+09:00 [INFO] - nodex_agent::controllers::public::nodex_receive - Verify success. message_id = 4cc6b394-751b-4e0c-b8c5-79d61adfafb0, from = did:nodex:test:EiD8Qwf0dDwGuwgBgBFsNb8AnFhQ64Sw1yCAEbBf2s8PRg - src/controllers/public/nodex_receive.rs:113
2024-03-19T21:15:51.966162+09:00 [ERROR] - nodex_agent::controllers::public::nodex_receive - Error: Is a directory (os error 21) - src/controllers/public/nodex_receive.rs:269
2024-03-19T21:15:55.766959+09:00 [INFO] - nodex_agent::controllers::public::nodex_receive - Receive message. message_id = "4cc6b394-751b-4e0c-b8c5-79d61adfafb0" - src/controllers/public/nodex_receive.rs:110
2024-03-19T21:15:55.855133+09:00 [INFO] - nodex_agent::controllers::public::nodex_receive - Verify success. message_id = 4cc6b394-751b-4e0c-b8c5-79d61adfafb0, from = did:nodex:test:EiD8Qwf0dDwGuwgBgBFsNb8AnFhQ64Sw1yCAEbBf2s8PRg - src/controllers/public/nodex_receive.rs:113
2024-03-19T21:15:56.648521+09:00 [ERROR] - nodex_agent::controllers::public::nodex_receive - Error: Is a directory (os error 21) - src/controllers/public/nodex_receive.rs:269
^C2024-03-19T12:15:57.784718+00:00 [INFO] - actix_server::server - SIGINT received; starting forced shutdown - /Users/dai/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-server-2.3.0/src/server.rs:319
2024-03-19T12:15:57.785050+00:00 [INFO] - actix_server::accept - accept thread stopped - /Users/dai/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-server-2.3.0/src/accept.rs:143
2024-03-19T12:15:57.785183+00:00 [INFO] - nodex_agent::controllers::public::nodex_receive - Polling task is stopped - src/controllers/public/nodex_receive.rs:118
2024-03-19T12:15:57.785257+00:00 [INFO] - actix_server::worker - shutting down idle worker - /Users/dai/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-server-2.3.0/src/worker.rs:595
2024-03-19T21:15:57.785664+09:00 [INFO] - actix_server::server - SIGINT received; starting forced shutdown - /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-server-2.1.1/src/server.rs:319
2024-03-19T21:15:57.785854+09:00 [INFO] - actix_server::accept - Accept thread stopped - /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-server-2.1.1/src/accept.rs:143
2024-03-19T21:15:57.786037+09:00 [INFO] - actix_server::worker - Shutting down idle worker - /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-server-2.1.1/src/worker.rs:593
2024-03-19T12:15:58.087939+00:00 [INFO] - nodex_agent::handlers::sender - stop sender - src/handlers/sender.rs:68
2024-03-19T21:15:58.087785+09:00 [INFO] - nodex_agent::handlers::sender - stop sender - src/handlers/sender.rs:68

da13da avatar Mar 19 '24 12:03 da13da