Skip to content

Commit 5803b32

Browse files
authored
Merge pull request #240 from kalafut/master
Use name parameter from settings file if present
2 parents c158e6c + f0befa4 commit 5803b32

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

cmd/server/main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,14 @@ func main() {
140140
}
141141

142142
klog.Infof("Loaded %d rules", len(ts))
143+
144+
// Establish site name based on the first available
145+
// of: CLI parameter, settings file, or default from repo names.
143146
sn := *siteName
144147
if sn == "" {
145-
sn = calculateSiteName(ts)
148+
if sn = tp.Name(); sn == "" {
149+
sn = calculateSiteName(ts)
150+
}
146151
}
147152

148153
u := updater.New(updater.Config{

pkg/triage/triage.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,3 +342,8 @@ func processRules(raw map[string]Rule) (map[string]Rule, error) {
342342
func (p *Party) ConversationsTotal() int {
343343
return p.engine.ConversationsTotal()
344344
}
345+
346+
// Name returns the configured site name
347+
func (p *Party) Name() string {
348+
return p.settings.Name
349+
}

0 commit comments

Comments
 (0)