Skip to content

Team Spirit Cron Job

SAI-NEEL-BADI edited this page Sep 15, 2022 · 5 revisions

Team spirit cron job

Team spirit cron job is responsible to fetch team spirit rating continuously from Team Spirit application and save the surveys with rating in database.

Start cron job for a team

  1. Found team name in team spirit application

    • get survey results
      • case 1: surveys exist completed surveys and on going survey
        1. get latest completed survey and save in db if survey doesn't exist in db
        2. schedule first cron job on scheduled date(today < latest survey end date + frequency )
          • fetch latest survey and save in db if not saved in db
          • start second cron job for every frequency days
          • terminates first cron job
        3. run second cron job for every frequency days
          • fetch latest survey and save in db if survey rating doesn't exist in db
      • case 2: surveys does not exist completed surveys and exists on going survey
         1. Schedule first cron job latest survey end date
              * fetch survey on trigger of cron job and save it in db
              * start second cron job for every frequency days
              * terminates first cron job
         2. Run second cron for every frequency days
              * fetch latest survey and save in db if survey doesn't exist in db.
  2. Team not found in team spirit application

    • send error message as "Team name not found in team spirit application.

Restart cron job for a team

  1. if cron job for a team is already running
    • stop cron job for a team
  2. start cron job for a team
Clone this wiki locally