Skip to content

Commit

Permalink
chore: some additional logging
Browse files Browse the repository at this point in the history
  • Loading branch information
alecthomas committed Oct 20, 2023
1 parent 2a19796 commit 5bdf72c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Bitfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ NODE_MODULES_IN = console/client/package{,-lock}.json
%{RELEASE}/ftl-runner: %{RELEASE} %{GO_SOURCES} cmd/ftl-runner/**/*.go
build: go build -o %{OUT} -tags release -ldflags "-X main.version=%{VERSION} -X main.timestamp=$(date +%s)" ./cmd/ftl-runner

%{RELEASE}/ftl: %{RELEASE} %{GO_SOURCES} cmd/ftl/**/*.go {go,kotlin}-runtime/scaffolding.zip
%{RELEASE}/ftl: %{RELEASE} %{GO_SOURCES} cmd/ftl/**/*.go {go,kotlin}-runtime/scaffolding.zip %{CLIENT_OUT}
build: go build -o %{OUT} -tags release -ldflags "-X main.version=%{VERSION} -X main.timestamp=$(date +%s)" ./cmd/ftl

%{RELEASE}/ftl-initdb: %{RELEASE} %{GO_SOURCES} cmd/ftl-initdb/**/*.go
Expand Down
4 changes: 4 additions & 0 deletions backend/controller/internal/dal/dal.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/jackc/pgx/v5/pgxpool"
"google.golang.org/protobuf/proto"

"github.com/TBD54566975/ftl/backend/common/log"
"github.com/TBD54566975/ftl/backend/common/maps"
"github.com/TBD54566975/ftl/backend/common/model"
"github.com/TBD54566975/ftl/backend/common/pubsub"
Expand Down Expand Up @@ -401,6 +402,8 @@ type IngressRoutingEntry struct {
//
// If an existing deployment with identical artefacts exists, it is returned.
func (d *DAL) CreateDeployment(ctx context.Context, language string, schema *schema.Module, artefacts []DeploymentArtefact, ingressRoutes []IngressRoutingEntry) (key model.DeploymentName, err error) {
logger := log.FromContext(ctx)

// Start the transaction
tx, err := d.db.Begin(ctx)
if err != nil {
Expand All @@ -418,6 +421,7 @@ func (d *DAL) CreateDeployment(ctx context.Context, language string, schema *sch
return "", errors.Wrap(err, "couldn't check for existing deployment")
}
if len(existing) > 0 {
logger.Debugf("Returning existing deployment %s", existing[0].DeploymentName)
return existing[0].DeploymentName, nil
}

Expand Down
2 changes: 2 additions & 0 deletions backend/controller/internal/dal/notify.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ func (d *DAL) runListener(ctx context.Context, conn *pgx.Conn) {
// Main loop for listening to notifications.
for {
delay := time.Millisecond * 100
logger.Debugf("Waiting for notification")
notification, err := waitForNotification(ctx, conn)
if err == nil {
logger.Debugf("Publishing notification: %s", notification)
err = d.publishNotification(ctx, notification, logger)
}
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion go-runtime/compile/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ type directiveAttr struct {
type directiveValue struct {
Bool *dirBool `parser:" @('true'|'false')"`
Ident *string `parser:"| @Ident"`
Path *string `parser:"| @('/' Ident)+"`
Path *string `parser:"| @(('/' (('{' Ident '}') | Ident))+ '/'?)"`
Str *string `parser:"| @String"`
Int *int64 `parser:"| @Int"`
Float *float64 `parser:"| @Float"`
Expand Down

0 comments on commit 5bdf72c

Please sign in to comment.