Skip to content

Commit

Permalink
use SteadyTimer for cleaning up inactive streams (#45)
Browse files Browse the repository at this point in the history
so that cleanup works correctly even if system time changes
  • Loading branch information
flixr authored and jihoonl committed Jan 8, 2018
1 parent 80c2fc4 commit ae74f19
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/web_video_server/web_video_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class WebVideoServer
void cleanup_inactive_streams();

ros::NodeHandle nh_;
ros::Timer cleanup_timer_;
ros::SteadyTimer cleanup_timer_;
int ros_threads_;
int port_;
std::string address_;
Expand Down
2 changes: 1 addition & 1 deletion src/web_video_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ WebVideoServer::WebVideoServer(ros::NodeHandle &nh, ros::NodeHandle &private_nh)
nh_(nh), handler_group_(
async_web_server_cpp::HttpReply::stock_reply(async_web_server_cpp::HttpReply::not_found))
{
cleanup_timer_ = nh.createTimer(ros::Duration(0.5), boost::bind(&WebVideoServer::cleanup_inactive_streams, this));
cleanup_timer_ = nh.createSteadyTimer(ros::WallDuration(0.5), boost::bind(&WebVideoServer::cleanup_inactive_streams, this));

private_nh.param("port", port_, 8080);
private_nh.param("verbose", __verbose, true);
Expand Down

0 comments on commit ae74f19

Please sign in to comment.