|
@ -6,8 +6,8 @@ import ( |
|
|
"time" |
|
|
"time" |
|
|
|
|
|
|
|
|
"git.aiterp.net/rpdata/api/internal/counter" |
|
|
"git.aiterp.net/rpdata/api/internal/counter" |
|
|
"git.aiterp.net/rpdata/api/model/channel" |
|
|
|
|
|
"git.aiterp.net/rpdata/api/models" |
|
|
"git.aiterp.net/rpdata/api/models" |
|
|
|
|
|
"git.aiterp.net/rpdata/api/models/channels" |
|
|
"github.com/globalsign/mgo/bson" |
|
|
"github.com/globalsign/mgo/bson" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
@ -18,7 +18,7 @@ func Add(date time.Time, channelName, title, eventName, description string, open |
|
|
return models.Log{}, errors.New("Failed to allocate short ID: " + err.Error()) |
|
|
return models.Log{}, errors.New("Failed to allocate short ID: " + err.Error()) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
_, err = channel.Ensure(channelName, open) |
|
|
|
|
|
|
|
|
_, err = channels.Ensure(channelName, open) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return models.Log{}, errors.New("Failed to ensure channel: " + err.Error()) |
|
|
return models.Log{}, errors.New("Failed to ensure channel: " + err.Error()) |
|
|
} |
|
|
} |
|
|