Skip to content

Commit

Permalink
[#3868] Fix configuration bug crashing whatsapp component
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Pröschel committed Oct 23, 2022
1 parent 038da04 commit 4fa0abc
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 57 deletions.
29 changes: 2 additions & 27 deletions backend/components/cognigy/helm/BUILD
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("@com_github_airyhq_bazel_tools//helm:helm.bzl", "helm_template_test")
load("//tools/build:helm.bzl", "helm_push")
load("//tools/build:helm.bzl", "helm_ruleset_core_version")

filegroup(
name = "files",
srcs = glob(
["**/*"],
exclude = ["BUILD"],
),
visibility = ["//visibility:public"],
)

pkg_tar(
name = "package",
srcs = [":files"],
extension = "tgz",
strip_prefix = "./",
)

helm_template_test(
name = "template",
chart = ":package",
)

helm_push(
chart = ":package",
)
helm_ruleset_core_version()
29 changes: 2 additions & 27 deletions backend/components/rasa/helm/BUILD
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("@com_github_airyhq_bazel_tools//helm:helm.bzl", "helm_template_test")
load("//tools/build:helm.bzl", "helm_push")
load("//tools/build:helm.bzl", "helm_ruleset_core_version")

filegroup(
name = "files",
srcs = glob(
["**/*"],
exclude = ["BUILD"],
),
visibility = ["//visibility:public"],
)

pkg_tar(
name = "package",
srcs = [":files"],
extension = "tgz",
strip_prefix = "./",
)

helm_template_test(
name = "template",
chart = ":package",
)

helm_push(
chart = ":package",
)
helm_ruleset_core_version()
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,17 @@ public void onApplicationEvent(ApplicationStartedEvent applicationStartedEvent)

// Foreign key join on channels so that we have channels information for marking messages read
final KTable<String, MessageWithChannel> messagesWithChannel = messageStream.toTable().join(channelsTable, Message::getChannelId,
(message, channel) -> MessageWithChannel.builder().channel(channel).message(message).build());
(message, channel) -> MessageWithChannel.builder().channel(channel).message(message).build());

// Contact messages table for marking them as read
final KTable<String, MessageWithChannel> markMessageReadTable = metadataStream
.filter((id, metadata) -> metadata.getKey().equals(MetadataKeys.MessageKeys.Source.ID))
.filter((id, metadata) -> metadata != null && metadata.getKey().equals(MetadataKeys.MessageKeys.Source.ID))
.groupBy((id, metadata) -> getSubject(metadata).getIdentifier())
.reduce((v1, v2) -> v2)
.join(messagesWithChannel, (metadata, messageWithChannel) ->
messageWithChannel.toBuilder().sourceMessageId(metadata.getValue()).build());

metadataStream.filter((id, metadata) -> metadata.getKey().equals(MetadataKeys.MessageKeys.READ_BY_USER))
metadataStream.filter((id, metadata) -> metadata != null && metadata.getKey().equals(MetadataKeys.MessageKeys.READ_BY_USER))
.selectKey((id, metadata) -> getSubject(metadata).getIdentifier())
.join(markMessageReadTable, (metadata, messageWithChannel) -> messageWithChannel)
.peek((messageId, messageWithChannel) -> connector.markMessageRead(messageWithChannel));
Expand Down
11 changes: 11 additions & 0 deletions backend/components/whatsapp/helm/templates/deployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ spec:
name: core-config
- configMapRef:
name: "{{ .Values.name }}"
env:
- name: REQUESTED_CPU
valueFrom:
resourceFieldRef:
containerName: app
resource: requests.cpu
- name: LIMIT_CPU
valueFrom:
resourceFieldRef:
containerName: app
resource: limits.cpu
livenessProbe:
httpGet:
path: /actuator/health
Expand Down

0 comments on commit 4fa0abc

Please sign in to comment.