diff options
Diffstat (limited to 'server_main.cpp')
-rw-r--r-- | server_main.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/server_main.cpp b/server_main.cpp index 8d2c4aa..34cb50c 100644 --- a/server_main.cpp +++ b/server_main.cpp | |||
@@ -36,7 +36,8 @@ class server { | |||
36 | socket_.listen(port_); | 36 | socket_.listen(port_); |
37 | socket_.start_accept(); | 37 | socket_.start_accept(); |
38 | 38 | ||
39 | asio::post(std::bind(&server::cleanup_thread, this)); | 39 | std::thread cleanup(std::bind(&server::cleanup_thread, this)); |
40 | cleanup.detach(); | ||
40 | 41 | ||
41 | std::cout << "Listening on port " << port_ << "..." << std::endl; | 42 | std::cout << "Listening on port " << port_ << "..." << std::endl; |
42 | 43 | ||
@@ -145,7 +146,9 @@ class server { | |||
145 | 146 | ||
146 | void cleanup_thread() { | 147 | void cleanup_thread() { |
147 | for (;;) { | 148 | for (;;) { |
148 | // sleep | 149 | std::this_thread::sleep_for(std::chrono::hours(24)); |
150 | |||
151 | images_.cleanup(); | ||
149 | } | 152 | } |
150 | } | 153 | } |
151 | 154 | ||