fix store file name conflict
This commit is contained in:
parent
e3b7bddf05
commit
f1c989ad36
@ -62,5 +62,5 @@ public:
|
||||
private:
|
||||
std::unordered_map<string, string> data_;
|
||||
mutable std::mutex mutex_;
|
||||
string filename_ = "server_store.txt";
|
||||
string filename_ = "store.txt";
|
||||
};
|
||||
|
2
main.cpp
2
main.cpp
@ -7,6 +7,8 @@ HttpServer* server = nullptr;
|
||||
void signal_handler(int sig) {
|
||||
if (server) {
|
||||
std::cout << "\nShutting down server...\n";
|
||||
server->store.save();
|
||||
server->sessions.save();
|
||||
server->stop();
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,9 @@
|
||||
|
||||
class SessionStore {
|
||||
public:
|
||||
SessionStore() : rng_(std::random_device{}()) {}
|
||||
SessionStore() : rng_(std::random_device{}()) {
|
||||
store_.set_file("sessions.txt");
|
||||
}
|
||||
|
||||
std::string create() {
|
||||
std::string id = generate_id();
|
||||
|
Loading…
x
Reference in New Issue
Block a user