IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 21117


Ignore:
Timestamp:
Jan 13, 2009, 11:04:28 AM (17 years ago)
Author:
Paul Price
Message:

Increasing number of retries when opening a FITS file.
Previously was 5x0.2 sec = 1 sec. Bill reports that PS::IPP::Config
uses a wait of 5 sec, and things usually appear for the second attempt,
so the usual time for mounting is something between 0 and 5 sec.
Let's try 50x0.2 sec = 10 sec.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/fits/psFits.c

    r21116 r21117  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.83 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2009-01-13 20:53:38 $
     9 *  @version $Revision: 1.84 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2009-01-13 21:04:28 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3535#include "psFitsFloat.h"
    3636
    37 #define MAX_STRING_LENGTH 256  // maximum length string for FITS routines
    38 
    39 #define FITS_OPEN_RETRIES 5             // Number of retries to attempt when opening a FITS file
     37#define MAX_STRING_LENGTH 256           // Maximum length string for FITS routines
     38
     39#define FITS_OPEN_RETRIES 50            // Number of retries to attempt when opening a FITS file
    4040#define FITS_OPEN_RETRY_WAIT 200000     // Wait between retries (usec)
    4141
     
    5050    va_list ap;
    5151    va_start(ap, message);
    52     p_psErrorV (filename, lineno, func, PS_ERR_BAD_FITS, true, message, ap);
     52    p_psErrorV(filename, lineno, func, PS_ERR_BAD_FITS, true, message, ap);
    5353    va_end(ap);
    5454
     
    6565    char fitsErr[MAX_STRING_LENGTH];
    6666
    67     if (status == 0) return PS_ERR_NONE;
     67    if (status == 0) {
     68        return PS_ERR_NONE;
     69    }
    6870
    6971    va_list ap;                         // Variable arguments
    7072    va_start(ap, errorMsg);
    71     psErrorV (PS_ERR_IO, new, errorMsg, ap);
     73    psErrorV(PS_ERR_IO, new, errorMsg, ap);
    7274    va_end(ap);
    7375
     
    138140    int dirstat = 0;                    // Status of directory access
    139141    psString tmpname = psStringCopy(name); // Copy of filename, since dirname() may modify
    140     const char *dir = dirname(tmpname);
    141     useconds_t waittime = FITS_OPEN_RETRY_WAIT;
     142    const char *dir = dirname(tmpname); // Directory for file
     143    useconds_t waittime = FITS_OPEN_RETRY_WAIT; // Wait time between retries (usec)
    142144
    143145    for (int i = 0; (i < FITS_OPEN_RETRIES) && ((dirstat = access(dir, F_OK)) != 0); i++) {
Note: See TracChangeset for help on using the changeset viewer.