Changeset 6893 for branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.3/HiveService.cs
- Timestamp:
- 10/09/11 01:47:51 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.3/HiveService.cs
r6764 r6893 446 446 447 447 #region Slave Methods 448 public int GetNewHeartbeatInterval(Guid slaveId) { 449 authen.AuthenticateForAnyRole(HiveRoles.Slave); 450 Slave s = dao.GetSlave(slaveId); 451 if (s != null) { 452 return s.HbInterval; 453 } else { 454 return -1; 455 } 456 } 457 448 458 public Guid AddSlave(Slave slave) { 449 459 authen.AuthenticateForAnyRole(HiveRoles.Administrator); … … 486 496 authen.AuthenticateForAnyRole(HiveRoles.Administrator); 487 497 trans.UseTransaction(() => { 488 dao.UpdateSlaveGroup(slaveGroup); 489 }); 498 UpdateSlaveHBs(slaveGroup); 499 }); 500 } 501 502 private void UpdateSlaveHBs(Resource r) { 503 foreach (Resource resource in dao.GetChildResources(r.Id)) { 504 if (resource is SlaveGroup) { 505 resource.HbInterval = r.HbInterval; 506 dao.UpdateSlaveGroup(resource as SlaveGroup); 507 UpdateSlaveHBs(resource); 508 } else if (resource is Slave) { 509 resource.HbInterval = r.HbInterval; 510 dao.UpdateSlave(resource as Slave); 511 } 512 } 490 513 } 491 514
Note: See TracChangeset
for help on using the changeset viewer.