Changeset 12907 for trunk


Ignore:
Timestamp:
02/19/12 10:21:43 (13 years ago)
Author:
tbretz
Message:
Do not throw an exception if a server which is requested to be removed is not in the list; datalogger should now accept this condition, too.
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/DimServiceInfoList.cc

    r12349 r12907  
    121121void DimServiceInfoList::RemoveServer(const string s)
    122122{
     123    RemoveAllServices(s);
     124
    123125    const ServiceInfoList::iterator v = fServiceInfoList.find(s);
    124126    if (v==fServiceInfoList.end())
     127        return;
     128    /*
    125129    {
    126130        stringstream err;
    127131        err << "DimServiceInfoList: Server '" << s << "' not in list as it ought to be.";
    128132        throw runtime_error(err.str());
    129     }
    130 
    131     RemoveAllServices(s);
     133    }*/
    132134
    133135    // Remove the server from the server list
  • trunk/FACT++/src/datalogger.cc

    r12890 r12907  
    471471    if (list.find(service) != list.end())
    472472    {
    473         Error("Service " + server + "/" + service + " is already in the dataLogger's list. ignoring its update.");
     473        Error("Service " + server + "/" + service + " is already in the dataLogger's list... ignoring update.");
    474474        return;
    475475    }
     
    502502    if (fServiceSubscriptions.find(server) == fServiceSubscriptions.end())
    503503    {
    504       Error("Server " + server + " not found while removing service " + service);
    505       return;
     504        Error("Request to remove service "+service+" from server "+server+", but service not found.");
     505        return;
    506506    }
    507507
     
    532532void DataLogger::RemoveAllServices(const string& server)
    533533{
     534    if (fServiceSubscriptions.find(server)==fServiceSubscriptions.end())
     535    {
     536        Warn("Request to remove all services, but corresponding server " + server + " not found.");
     537        return;
     538    }
     539
    534540    fNumSubAndFitsData.numSubscriptions -= fServiceSubscriptions[server].size();
     541
    535542    fServiceSubscriptions[server].clear();
    536543    fServiceSubscriptions.erase(server);
     544
    537545    if (server == "FAD_CONTROL")
    538546        fRunNumberService = NULL;
     547
    539548    if (fDebugIsOn)
    540     {
    541549        Debug("Removed all subscriptions to " + server + "/");
    542     }
    543550}
    544551
Note: See TracChangeset for help on using the changeset viewer.