Changeset 11254
- Timestamp:
- 07/05/11 10:25:26 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/scheduler.cc
r11251 r11254 154 154 }; 155 155 156 int fSessionId;157 156 string fDatabase; 158 157 string fDBName; … … 632 631 T::Message("Scheduling done."); 633 632 634 fSessionId = -1; 635 636 return error ? T::kSM_Error : T::kSM_Ready; 633 return error; 637 634 } 638 635 … … 655 652 */ 656 653 657 AutoScheduler(ostream &out=cout) : T(out, "SCHEDULER"), fNextIsPreview(true), f SessionId(-1), fDBName("")654 AutoScheduler(ostream &out=cout) : T(out, "SCHEDULER"), fNextIsPreview(true), fDBName("") 658 655 { 659 656 AddStateName(kSM_Scheduling, "Scheduling", "Scheduling in progress."); … … 678 675 try 679 676 { 680 return Schedule() ;677 return Schedule() ? T::kSM_Error : T::kSM_Ready; 681 678 } 682 679 catch (const mysqlpp::Exception &e) … … 689 686 case T::kSM_Error: 690 687 return T::kSM_Ready; 691 692 //case kSM_Comitting:693 // return Commit();694 688 } 695 689 return T::GetCurrentState(); … … 703 697 if (evt.GetSize()>0) 704 698 fDBName = evt.GetText(); 705 //case kSM_Comitting:706 //fSessionId = evt.GetInt();707 699 break; 708 700 } … … 710 702 return evt.GetTargetState(); 711 703 } 712 int Configure(const Event &) 713 { 714 return T::GetCurrentState(); 715 } 716 717 bool SetConfiguration(const Configuration &conf) 718 { 719 fDatabase = conf.Get<string>("schedule-database"); 704 705 int EvalConfiguration(const Configuration &conf) 706 { 707 fDatabase = conf.Get<string>("schedule-database"); 720 708 fDurationCalRun = conf.Get<int>("duration-cal-run"); 721 709 fDurationPedRun = conf.Get<int>("duration-ped-run"); 722 710 fDurationRepos = conf.Get<int>("duration-repos"); 723 711 724 return true; 712 if (!conf.Has("schedule")) 713 return -1; 714 715 fDBName = conf.Get<string>("schedule"); 716 return Schedule(); 725 717 } 726 718 … … 755 747 // Start io_service.run to only use the commandHandler command detaching 756 748 AutoScheduler<S> io_service(wout); 757 if (!io_service. SetConfiguration(conf))749 if (!io_service.EvalConfiguration(conf)) 758 750 return -1; 759 751 … … 779 771 780 772 AutoScheduler<S> io_service(wout); 781 if (!io_service. SetConfiguration(conf))773 if (!io_service.EvalConfiguration(conf)) 782 774 return -1; 783 775 … … 840 832 #endif 841 833 , "Database link as in\n\t[user:[password]@][server][:port][/database]\nOverwrites options from the default configuration file.") 834 ("schedule", var<string>(), "") 842 835 ("mintime", var<int>(), "minimum observation time") 843 836 ("duration-cal-run", var<int>() … … 859 852 860 853 po::positional_options_description p; 861 p.add("schedule -database", 1); // The first positional options854 p.add("schedule", 1); // The first positional options 862 855 863 856 conf.AddEnv("dns", "DIM_DNS_NODE");
Note:
See TracChangeset
for help on using the changeset viewer.