Skip to content

Commit 9e24492

Browse files
committed
test
1 parent c234059 commit 9e24492

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ APK_PACKAGE := ./build/$(PACKAGE_NAME).apk
6060
DEB_PACKAGE := ./build/$(PACKAGE_NAME).deb
6161
RPM_PACKAGE := ./build/$(PACKAGE_NAME).rpm
6262

63-
MOCK_MANAGEMENT_PLANE_CONFIG_DIRECTORY ?=
64-
MOCK_MANAGEMENT_PLANE_LOG_LEVEL ?= INFO
65-
MOCK_MANAGEMENT_PLANE_GRPC_ADDRESS ?= 127.0.0.1:0
66-
MOCK_MANAGEMENT_PLANE_API_ADDRESS ?= 127.0.0.1:0
63+
MOCK_MANAGEMENT_PLANE_CONFIG_DIRECTORY ?= /mnt/hgfs/go/configs/
64+
MOCK_MANAGEMENT_PLANE_LOG_LEVEL ?= DEBUG
65+
MOCK_MANAGEMENT_PLANE_GRPC_ADDRESS ?= 127.0.0.1:9091
66+
MOCK_MANAGEMENT_PLANE_API_ADDRESS ?= 127.0.0.1:9092
6767
OLD_BENCHMARK_RESULTS_FILE ?= $(TEST_BUILD_DIR)/benchmark.txt
6868

6969
uname_m := $(shell uname -m)

internal/watcher/watcher_plugin.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,10 @@ func (w *Watcher) monitorWatchers(ctx context.Context) {
219219
w.handleInstanceUpdates(newCtx, message)
220220
case message := <-w.nginxConfigContextChannel:
221221
newCtx := context.WithValue(ctx, logger.CorrelationIDContextKey, message.CorrelationID)
222-
slog.Info("============= Nginx Config Context Channel got Context")
223-
// w.watcherMutex.Lock()
222+
slog.Info("============= Nginx Config Context Channel")
223+
w.watcherMutex.Lock()
224224
if !slices.Contains(w.instancesWithConfigApplyInProgress, message.NginxConfigContext.InstanceID) {
225+
slog.Info("============= Nginx Config Context update")
225226
slog.DebugContext(
226227
newCtx,
227228
"Updated NGINX config context",
@@ -239,7 +240,8 @@ func (w *Watcher) monitorWatchers(ctx context.Context) {
239240
"nginx_config_context", message.NginxConfigContext,
240241
)
241242
}
242-
// w.watcherMutex.Unlock()
243+
w.watcherMutex.Unlock()
244+
slog.Info("============= Nginx Config Unlock")
243245
case message := <-w.instanceHealthChannel:
244246
newCtx := context.WithValue(ctx, logger.CorrelationIDContextKey, message.CorrelationID)
245247
w.messagePipe.Process(newCtx, &bus.Message{

nginx-agent.conf

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
log:
88
# set log level (error, info, debug; default "info")
9-
level: info
9+
level: debug
1010
# set log path. if empty, don't log to file.
1111
path: /var/log/nginx-agent/
1212

@@ -17,6 +17,14 @@ allowed_directories:
1717
- /var/run/nginx
1818
- /var/log/nginx
1919

20+
command:
21+
server:
22+
# the server host to connect to in order to send and receive commands e.g. config apply instructions
23+
host: 127.0.0.1
24+
# the server port to connect to in order to send and receive commands e.g. config apply instructions
25+
port: 9091
26+
# the type of connection. Options are "grpc" or "http"
27+
type: grpc
2028
## command server settings
2129
# command:
2230
# server:

0 commit comments

Comments
 (0)