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