Skip to content

Commit c65c79b

Browse files
authored
Merge pull request #10 from longbridgeapp/feature/m-14237093_simulator
Feature/m-14237093 support DynamicSessions
2 parents dbfec28 + 1509ed7 commit c65c79b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

gormstroe.go

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

77
"github.com/pkg/errors"
88
"gorm.io/gorm"
9+
10+
"github.com/quickfixgo/quickfix/config"
911
)
1012

1113
type gormStoreFactory struct {
@@ -24,8 +26,14 @@ type gromStore struct {
2426
}
2527

2628
func (f gormStoreFactory) Create(sessionID SessionID) (msgStore MessageStore, err error) {
29+
var dynamicSessions bool
30+
if f.settings.GlobalSettings().HasSetting(config.DynamicSessions) {
31+
if dynamicSessions, err = f.settings.globalSettings.BoolSetting(config.DynamicSessions); err != nil {
32+
return
33+
}
34+
}
2735
_, ok := f.settings.SessionSettings()[sessionID]
28-
if !ok {
36+
if !ok && !dynamicSessions {
2937
return nil, fmt.Errorf("unknown session: %v", sessionID)
3038
}
3139

0 commit comments

Comments
 (0)