Compare commits
No commits in common. "e6ef66194e9c2b95bde41b23d06788e95b1a06dd" and "0a00ee8323c27cda5a92f80907c80acde8ef507b" have entirely different histories.
e6ef66194e
...
0a00ee8323
4
api.go
4
api.go
@ -95,12 +95,12 @@ func (s *HTTPServer) RegisterAPIRoutes(r *mux.Router) {
|
||||
}
|
||||
|
||||
// Get current time and default conversation.
|
||||
now := time.Now().UTC()
|
||||
now := time.Now()
|
||||
conversation := app.config.Slack.AdminID
|
||||
|
||||
// Find plan times that are occuring right now.
|
||||
var planTime PlanTimes
|
||||
app.db.Where("time_type='service' AND starts_at < ? AND ends_at > ?", now, now).First(&planTime)
|
||||
app.db.Where("time_type='service' AND starts_at < ? AND ends_at < ?", now, now).First(&planTime)
|
||||
if planTime.Plan != 0 {
|
||||
// If plan found, check for the slack channel.
|
||||
var channel SlackChannels
|
||||
|
@ -297,7 +297,7 @@ func CreateSlackChannels() {
|
||||
// setting a day of the week for slack channels to be created on.
|
||||
// Doing a day of the week will allow for channels to be created ahead of time, then
|
||||
// if people are added to the plan later on, they can be added at the next cron run.
|
||||
startDate := time.Now().UTC()
|
||||
startDate := time.Now()
|
||||
// Last date is start date plus duration of create channels ahead.
|
||||
lastDate := startDate.Add(app.config.Slack.CreateChannelsAhead)
|
||||
|
||||
@ -411,6 +411,7 @@ func CreateSlackChannels() {
|
||||
app.db.Create(&channel)
|
||||
}
|
||||
|
||||
|
||||
// Get the previous users that were invited to the channel.
|
||||
invited := strings.Split(channel.UsersInvited, ",")
|
||||
// If nothing is previous, reset the slice to nil.
|
||||
|
Loading…
Reference in New Issue
Block a user