Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

Commit

Permalink
Update to use dep, fix validation on fn IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
zootalures committed Sep 10, 2018
1 parent 440209b commit f454a3c
Show file tree
Hide file tree
Showing 1,578 changed files with 32,538 additions and 509,488 deletions.
2 changes: 1 addition & 1 deletion actor/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ func (m *actorManager) StreamEvents(gr *model.StreamGraphRequest, stream model.F
func(event *persistence.StreamEvent) {
msg, ok := event.Event.(model.StreamableGraphEvent)
if !ok {
m.log.Info("Skipping unknown message %v", reflect.TypeOf(event.Event))
m.log.Infof("Skipping unknown message %v", reflect.TypeOf(event.Event))
return
}

Expand Down
24 changes: 1 addition & 23 deletions actor/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import (
"reflect"
"time"

"regexp"

"github.com/AsynkronIT/protoactor-go/actor"
protoPersistence "github.com/AsynkronIT/protoactor-go/persistence"
"github.com/fnproject/flow/graph"
Expand Down Expand Up @@ -205,10 +203,7 @@ func (g *graphActor) receiveCommand(cmd model.Command, context actor.Context) {
g.log.Debug("Adding invoke stage")
stageID := g.graph.NextStageID()

realFunctionID, err := resolveFunctionID(g.graph.FunctionID, msg.FunctionId)
if err != nil {
panic(fmt.Sprintf("Unable to parse function ID (%s | %s): %s", g.graph.FunctionID, msg.FunctionId, err))
}
realFunctionID := msg.FunctionId

g.persistAndUpdateGraph(&model.StageAddedEvent{
FlowId: msg.FlowId,
Expand Down Expand Up @@ -315,23 +310,6 @@ func (g *graphActor) receiveCommand(cmd model.Command, context actor.Context) {
}
}

var appIDRegex = regexp.MustCompile("^([^/]+)/(.*)$")

func resolveFunctionID(original string, relative string) (string, error) {
orig, err := model.ParseFunctionID(original)
if err != nil {
return "", err
}
rel, err := model.ParseFunctionID(relative)
if err != nil {
return "", err
}

if rel.AppID == "." {
rel.AppID = orig.AppID
}
return rel.String(), nil
}

func (g *graphActor) receiveMessage(context actor.Context) {
switch msg := context.Message().(type) {
Expand Down
122 changes: 0 additions & 122 deletions glide.yaml

This file was deleted.

42 changes: 0 additions & 42 deletions model/fnid.go

This file was deleted.

55 changes: 0 additions & 55 deletions model/fnid_test.go

This file was deleted.

Loading

0 comments on commit f454a3c

Please sign in to comment.