Skip to content

Commit 550e076

Browse files
committed
feat: update main.tf
1 parent 563e910 commit 550e076

File tree

3 files changed

+6
-47
lines changed

3 files changed

+6
-47
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ _config
1818
# secret
1919
iam.json
2020
key.json
21+
config.json

README.md

Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -183,51 +183,9 @@ terraform show -json plan.out > plan.json
183183
docker run --rm -it -p 9000:9000 -v $(pwd)/plan.json:/src/plan.json im2nguyen/rover:latest -planJSONPath=plan.json
184184
```
185185

186-
Hello!
186+
## Useful
187187

188-
I want to change how I work with reminders, before I have reminder offest and reminder message id, now I have changed the type in db into json and will use the following Reminder object
189-
190-
```go
191-
type ReminderConfig struct {
192-
Offest time.Duration `json:"offset"`
193-
MessageID int `json:"message_id"`
194-
LastAt time.Time `json:"last_at"`
195-
}
196-
197-
type JamaatOffset struct {
198-
Fajr time.Duration `json:"fajr"` // default 10m
199-
Shuruq time.Duration `json:"shuruq"` // default 10m
200-
Dhuhr time.Duration `json:"dhuhr"` // default 10m
201-
Asr time.Duration `json:"asr"` // default 10m
202-
Maghrib time.Duration `json:"maghrib"` // default 10m
203-
Isha time.Duration `json:"isha"` // default 20m
204-
}
205-
206-
type Reminder struct {
207-
// last_at is a date without hours, if last_at + 24h - offset is less than now then trigger
208-
Today ReminderConfig `json:"today"`
209-
// if last_at < prayer_time-offset, then trigger
210-
Soon ReminderConfig `json:"soon"`
211-
// if last_at < prayer_time+offset then trigger
212-
Arrive ReminderConfig `json:"arrive"` // offset here not used
213-
// Use to set the value in Jamaat after X min
214-
GroupJamaatOffset JamaatOffset `json:"group_jamaa_offset"`
215-
}
188+
```bash
189+
export AWS_ACCESS_KEY_ID=$(jq -r '.aws_access_key_id' key.json)
190+
export AWS_SECRET_ACCESS_KEY=$(jq -r '.aws_secret_access_key' key.json)
216191
```
217-
218-
Now, to now that I need to send a message, event time + offset(might be negative) must be after last_at and before or equal now
219-
220-
Update the dispatcher code when setting reminder, the value will be set on soon.offset
221-
222-
add a today handler in reminder to send today's prayer message and delete previous one if any (using message_id)
223-
224-
Refactor the code in reminder so that we have checks for each reminder (today, soon, arrive), if check passed, send message and delete previous message_id and update last_at and message_id
225-
226-
---
227-
228-
I need you to improve this prompt instead of making changes
229-
230-
231-
232-
- update code to match new infra
233-
- delpoy to production

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ resource "yandex_function" "dispatcher_fn" {
235235
}
236236
}
237237

238-
output "dispatcher_fn_id" {
238+
output "dispatcher_function_id" {
239239
value = yandex_function.dispatcher_fn.id // used to set Webhook URL on Telegram
240240
}
241241

0 commit comments

Comments
 (0)