mirror of
https://github.com/typesense/typesense.git
synced 2025-05-20 05:32:30 +08:00
Handle SIGTERM and gracefully shut-down.
This commit is contained in:
parent
0f9c97eaf3
commit
928b5602de
2
TODO.md
2
TODO.md
@ -95,7 +95,7 @@
|
||||
- ~~Replica server should fail when pointed to "old" master~~
|
||||
- ~~gzip compress responses~~
|
||||
- ~~Have a LOG(ERROR) level~~
|
||||
- Handle SIGTERM which is sent when process is killed
|
||||
- ~~Handle SIGTERM which is sent when process is killed~~
|
||||
- Parameterize replica's MAX_UPDATES_TO_SEND
|
||||
- NOT operator support
|
||||
- > INT32_MAX validation for float field
|
||||
|
@ -64,7 +64,12 @@ void replica_server_routes() {
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
// remove SIGTERM since we handle it on our own
|
||||
g3::overrideSetupSignals({{SIGABRT, "SIGABRT"}, {SIGFPE, "SIGFPE"},{SIGILL, "SIGILL"}, {SIGSEGV, "SIGSEGV"},});
|
||||
|
||||
// we can install new signal handlers only after overriding above
|
||||
signal(SIGINT, catch_interrupt);
|
||||
signal(SIGTERM, catch_interrupt);
|
||||
|
||||
cmdline::parser options;
|
||||
options.add<std::string>("data-dir", 'd', "Directory where data will be stored.", true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user