Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Job::run()
- {
- while (true)
- {
- try
- {
- boost::mutex::scoped_lock lock(Job::io_mutex);
- string sqlConnectionString = "hostaddr="+server+" port="+port+
- " dbname="+dbname+" user="+user+
- " password="+password;
- session sql(postgresql, sqlConnectionString);
- string result;
- sql << sqlQuery, into(result);
- cout << interval << endl;
- cout << boost::this_thread::get_id() << endl;
- sql.close();
- }
- catch (std::exception const &e )
- {
- cerr << "Error: " << e.what() << '\n';
- }
- boost::this_thread::sleep(boost::posix_time::milliseconds(interval));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement