| 24 | ) |
| 25 | |
| 26 | func initDabatase() { |
| 27 | monitor := &event.CommandMonitor{ |
| 28 | Started: func(_ context.Context, e *event.CommandStartedEvent) { |
| 29 | //fmt.Println(e.Command) |
| 30 | }, |
| 31 | Succeeded: func(_ context.Context, e *event.CommandSucceededEvent) { |
| 32 | //fmt.Println(e.Reply) |
| 33 | }, |
| 34 | Failed: func(_ context.Context, e *event.CommandFailedEvent) { |
| 35 | //fmt.Println(e.Failure) |
| 36 | }, |
| 37 | } |
| 38 | opts := options.Client().SetMonitor(monitor) |
| 39 | mgm.SetDefaultConfig(nil, os.Getenv("DATABASE"), options.Client().ApplyURI(os.Getenv("DATABASE_URI")), opts) |
| 40 | } |
| 41 | func runScheduledNotifications() (err error) { |
| 42 | var subscriptionService = services.SubscriptionService{} |
| 43 | subscriptionService.RunNotifyExpiringTrials() |