Skip to content

Commit

Permalink
For #1635, inotify watch ConfigMap for reload. 3.0.132
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Mar 12, 2020
1 parent 940798a commit 88368ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions trunk/src/app/srs_app_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ srs_error_t SrsInotifyWorker::start()
// Watch the config directory events.
string config_dir = srs_path_dirname(_srs_config->config());
if (true) {
uint32_t mask = IN_MODIFY | IN_CREATE;
uint32_t mask = IN_ALL_EVENTS;
if (::inotify_add_watch(fd, config_dir.c_str(), mask) < 0) {
return srs_error_new(ERROR_INOTIFY_WATCH, "watch file=%s, fd=%d, mask=%#x", config_dir.c_str(), fd, mask);
}
Expand All @@ -549,7 +549,7 @@ srs_error_t SrsInotifyWorker::start()
// Watch k8s sub directory.
string k8s_file = config_dir + "/..data";
if (srs_path_exists(k8s_file)) {
uint32_t mask = IN_MODIFY;
uint32_t mask = IN_ALL_EVENTS;
if (::inotify_add_watch(fd, k8s_file.c_str(), mask) < 0) {
return srs_error_new(ERROR_INOTIFY_WATCH, "watch file=%s, fd=%d, mask=%#x", k8s_file.c_str(), fd, mask);
}
Expand Down Expand Up @@ -601,7 +601,7 @@ srs_error_t SrsInotifyWorker::cycle()

// Notify server to do reload.
if (do_reload && srs_path_exists(config_path)) {
server->on_signal(SRS_SIGNAL_RELOAD);
//server->on_signal(SRS_SIGNAL_RELOAD);
}

srs_usleep(3000 * SRS_UTIME_MILLISECONDS);
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/core/srs_core_version3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
#ifndef SRS_CORE_VERSION3_HPP
#define SRS_CORE_VERSION3_HPP

#define SRS_VERSION3_REVISION 131
#define SRS_VERSION3_REVISION 132

#endif

0 comments on commit 88368ed

Please sign in to comment.