From 74894278d80fb767646564a85857d8f2b19df410 Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 31 Dec 2025 18:47:00 -0500 Subject: [PATCH] tsk-9: Added comments and formatted code --- swoop/send/sender.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/swoop/send/sender.go b/swoop/send/sender.go index 5f3d7c7..96eab1a 100644 --- a/swoop/send/sender.go +++ b/swoop/send/sender.go @@ -15,11 +15,14 @@ import ( ) const Schedule_Type = "fixed" +const Schedulable_Limit_In_Seconds = 300 type MessageSender struct { Config *auxcfg.TwilioConfig } +// Sends a message to a contact via Twilio +// Has support for scheduling a time based on if it is in the future func (m *MessageSender) Send(msg message.Message, number contact.Contact, sendTime *time.Time) (*types.TwilioResult, map[string]any, error) { if m.Config == nil { return nil, nil, fmt.Errorf("Config has not been initialized") @@ -57,7 +60,7 @@ func (m *MessageSender) Send(msg message.Message, number contact.Contact, sendTi } func isSchedulable(now *time.Time, scheduled *time.Time) bool { - early := now.Add(300 * time.Second) + early := now.Add(Schedulable_Limit_In_Seconds * time.Second) if scheduled.After(early) { return true