Index: /trunk/psLib/src/fits/psFits.c
===================================================================
--- /trunk/psLib/src/fits/psFits.c	(revision 21430)
+++ /trunk/psLib/src/fits/psFits.c	(revision 21431)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.84 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2009-01-13 21:04:28 $
+ *  @version $Revision: 1.85 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2009-02-10 20:58:17 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -37,6 +37,7 @@
 #define MAX_STRING_LENGTH 256           // Maximum length string for FITS routines
 
-#define FITS_OPEN_RETRIES 50            // Number of retries to attempt when opening a FITS file
-#define FITS_OPEN_RETRY_WAIT 200000     // Wait between retries (usec)
+#define FITS_OPEN_RETRIES 16            // Number of retries to attempt when opening a FITS file
+#define FITS_OPEN_RETRY_WAIT_MIN 200000 // Wait between retries (usec) first time
+#define FITS_OPEN_RETRY_WAIT_MAX 5000000 // double wait time up to 5 sec
 
 static char *defaultExtword = "EXTNAME";
@@ -141,5 +142,5 @@
     psString tmpname = psStringCopy(name); // Copy of filename, since dirname() may modify
     const char *dir = dirname(tmpname); // Directory for file
-    useconds_t waittime = FITS_OPEN_RETRY_WAIT; // Wait time between retries (usec)
+    useconds_t waittime = FITS_OPEN_RETRY_WAIT_MIN; // Wait time between retries (usec)
 
     for (int i = 0; (i < FITS_OPEN_RETRIES) && ((dirstat = access(dir, F_OK)) != 0); i++) {
@@ -162,5 +163,8 @@
 
         usleep(waittime);
-        waittime *= 2;
+        // double waittime until we get to the max value
+        if (waittime < FITS_OPEN_RETRY_WAIT_MAX) {
+            waittime *= 2;
+        }
     }
     if (dirstat != 0) {
