8 maybe_s(
unsigned const i, std::string
const& word)
10 return i == 1u ? word : word +
"s";
18 auto const nschedules = globals.nschedules();
19 auto const nthreads = globals.nthreads();
20 if (nschedules == 1u && nthreads == 1u)
23 auto const service_type = service_pset.
get<std::string>(
"service_type");
25 e <<
"The service '" << service_type <<
'\'';
28 e <<
" (provider: '" << *provider <<
"')";
30 e <<
" is a legacy service,\n" 31 <<
"which can be used with only one schedule and one thread.\n" 32 <<
"This job uses " << nschedules << maybe_s(nschedules,
" schedule")
33 <<
" and " << nthreads << maybe_s(nthreads,
" thread") <<
".\n" 34 <<
"Please reconfigure your job to use only one schedule/thread.\n";
const std::string instance
T get(std::string const &key) const
void ensure_only_one_thread(fhicl::ParameterSet const &service_pset)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
std::optional< T > get_if_present(std::string const &key) const