Open Source alternative to Algolia + Pinecone and an Easier-to-Use alternative to ElasticSearch ⚡ 🔍 ✨ Fast, typo tolerant, in-memory fuzzy Search Engine for building delightful search experiences
C++ algoliadatastoreelasticsearchenterprise-searchfacetingfull-text-searchfuzzy-searchgeosearchin-memoryinstantsearchmerchandisingpineconesearchsearch-enginesemantic-searchsimilarity-searchsite-searchsynonymstypo-tolerancevector-search
Catch SIGINT.
Kishore Nallanc47cb18ac239
diff --git a/src/main/typesense_server.cpp b/src/main/typesense_server.cppindex 3da9adfb..2e1b7632 100644--- a/src/main/typesense_server.cpp+++ b/src/main/typesense_server.cpp@@ -1,7 +1,13 @@+#include <signal.h>+#include <iostream>#include <cmdline.h>#include "http_server.h"#include "api.h"+void catch_interrupt(int sig) {+ std::cout << "Quitting Typesense..." << std::endl;+}+int main(int argc, char **argv) {cmdline::parser options;options.add<std::string>("data-dir", 'd', "Directory where data will be stored.", true);@@ -10,6 +16,8 @@ int main(int argc, char **argv) {options.add<uint32_t>("listen-port", 'p', "Port on which Typesense server listens.", false, 8080);options.parse_check(argc, argv);+ signal(SIGINT, catch_interrupt);+Store store(options.get<std::string>("data-dir"));CollectionManager & collectionManager = CollectionManager::get_instance();collectionManager.init(&store, options.get<std::string>("api-auth-key"));