struct tm tm;
char dt[MAX_TIME_LENGTH];
int count = 0;
+ int limit = 99; /* limit + 1 is max jobs to start */
ids.list = get_pool_memory(PM_MESSAGE);
ids.list[0] = 0;
jcr->get_ActionName(1), ids.list);
Dmsg2(dbglevel, "Before loop count=%d ids=%s\n", ids.count, ids.list);
+ /*
+ * Note: to not over load the system, limit the number
+ * of new jobs started to 100 (see limit above)
+ */
for (int i=1; i < (int)ids.count; i++) {
JobId = 0;
stat = get_next_jobid_from_list(&p, &JobId);
goto ok_out;
}
jcr->MigrateJobId = JobId;
- start_migration_job(jcr);
- Dmsg0(dbglevel, "Back from start_migration_job\n");
+ /* Don't start any more when limit reaches zero */
+ limit--;
+ if (limit > 0) {
+ start_migration_job(jcr);
+ Dmsg0(dbglevel, "Back from start_migration_job\n");
+ }
}
/* Now get the last JobId and handle it in the current job */