How to implement Cron jobs with multiple databases.

150 views
Skip to first unread message

Mandeep Kaur

unread,
Jan 15, 2018, 12:40:24 AM1/15/18
to Google App Engine

I have build a saas product with angular integrated with golang rest api, this project provide vendors of a firm to maintain their store ( like shopify but for a small organization only ) where each vendor has a different database. on daily basis system should run corn jobs to send email and notification to their merchants. Each vendor has store setup on a sub-domain like merchant1.store.com and db with name merchant_1_db.


I used golang schedules to setup cron jobs but they are not running per vendor. I need help on how to setup parallel cron jobs for various merchants.

Kenworth (Google Cloud Platform)

unread,
Jan 16, 2018, 3:01:12 PM1/16/18
to google-a...@googlegroups.com
The 'target' string is prepended to your app's hostname. So an option would be to create multiple tasks on a single cron job. For example: 

cron:
- description: "daily merchant1 mailout"
  url
: /mail/merchant1
  schedule
: every 24 hours
- description: "daily merchant2 mailout"
  url
: /mail/merchant2
  schedule
: every 24 hours
-
description: "daily merchant3 mailout"
  url
: /mail/merchant3
  schedule
: every 24 hours

You can consult this documentation for more information.



Reply all
Reply to author
Forward
0 new messages