Changeset 19154 for trunk/FACT++


Ignore:
Timestamp:
08/11/18 22:01:57 (6 years ago)
Author:
tbretz
Message:
Removed the force-stuff, the constructor is now already connecting to the database.
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

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

    r19153 r19154  
    5050#endif
    5151         ,           "The root file to read from")
    52         ("force",          po_switch(),               "Force processing even if there is no database connection")
    5352        ("create",         po_switch(),               "Create the database if not existing")
    5453        ("drop",           po_switch(),               "Drop the table (implies create)")
     
    319318    const size_t  max            = conf.Get<size_t>("max");
    320319
    321     const bool force             = conf.Get<bool>("force");
    322320    const bool drop              = conf.Get<bool>("drop");
    323321    const bool create            = conf.Get<bool>("create") || drop;
     
    546544    // -------------------------------------------------------------------------
    547545    // Checking for database connection
     546    if (verbose>0)
     547        cout << "\n---------------------- Connecting database -------------------------" << endl;
    548548
    549549    Database connection(uri);
    550 
    551     try
    552     {
    553         if (!force)
    554             connection.connected();
    555     }
    556     catch (const exception &e)
    557     {
    558         cerr << "SQL connection failed: " << e.what() << '\n' << endl;
    559         return 4;
    560     }
    561550
    562551    if (verbose>0)
  • trunk/FACT++/src/root2sql.cc

    r19153 r19154  
    5454#endif
    5555         ,           "The root file to read from")
    56         ("force",          po_switch(),               "Force processing even if there is no database connection")
    5756        ("create",         po_switch(),               "Create the database if not existing")
    5857        ("drop",           po_switch(),               "Drop the table (implies create)")
     
    348347    const int64_t  max           = conf.Get<int64_t>("max");
    349348
    350     const bool force             = conf.Get<bool>("force");
    351349    const bool drop              = conf.Get<bool>("drop");
    352350    const bool create            = conf.Get<bool>("create") || drop;
     
    585583
    586584    Database connection(uri);
    587 
    588     try
    589     {
    590         if (!force)
    591             connection.connected();
    592     }
    593     catch (const exception &e)
    594     {
    595         cerr << "SQL connection failed: " << e.what() << '\n' << endl;
    596         return 3;
    597     }
    598585
    599586    if (verbose>0)
Note: See TracChangeset for help on using the changeset viewer.