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.
|
||||
now := time.Now()
|
||||
now := time.Now().UTC()
|
||||
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
|
||||
|
@ -184,7 +184,7 @@ func UpdatePCData() {
|
||||
p.UpdatedAt = attributes.GetDate("updated_at")
|
||||
p.Status = attributes.GetString("status")
|
||||
p.TeamPositionName = attributes.GetString("team_position_name")
|
||||
|
||||
|
||||
// If person wasn't existing, create them.
|
||||
if p.ID == 0 {
|
||||
p.ID = id
|
||||
@ -265,7 +265,7 @@ func UpdateSlackData() {
|
||||
sort.Slice(people, func(i, j int) bool {
|
||||
return people[i].Distance < people[j].Distance
|
||||
})
|
||||
|
||||
|
||||
// Debug output for comparing scores.
|
||||
// for _, person := range people {
|
||||
// fmt.Printf("%d %s (%s) %s\n", person.Distance, u.Name, u.RealName, person.FirstName+" "+person.LastName)
|
||||
@ -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()
|
||||
startDate := time.Now().UTC()
|
||||
// Last date is start date plus duration of create channels ahead.
|
||||
lastDate := startDate.Add(app.config.Slack.CreateChannelsAhead)
|
||||
|
||||
@ -411,7 +411,6 @@ 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