mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-23 04:21:45 +00:00
Implement the first real test of gpt4all-chat (#3116)
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
|
||||
#ifdef Q_OS_WINDOWS
|
||||
# include <windows.h>
|
||||
#else
|
||||
# include <signal.h>
|
||||
#endif
|
||||
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
@@ -130,6 +132,17 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef Q_OS_WINDOWS
|
||||
// handle signals gracefully
|
||||
struct sigaction sa;
|
||||
sa.sa_handler = [](int s) { QCoreApplication::exit(s == SIGINT ? 0 : 1); };
|
||||
sa.sa_flags = SA_RESETHAND;
|
||||
sigemptyset(&sa.sa_mask);
|
||||
sigaction(SIGINT, &sa, nullptr);
|
||||
sigaction(SIGTERM, &sa, nullptr);
|
||||
sigaction(SIGHUP, &sa, nullptr);
|
||||
#endif
|
||||
|
||||
int res = app.exec();
|
||||
|
||||
// Make sure ChatLLM threads are joined before global destructors run.
|
||||
|
Reference in New Issue
Block a user