comparison db.c @ 3:dc5ff2a1ed81

Be smarter about retries. If the interrupt endpoint can't be read 100 times then retry the whole request.
author Daniel O'Connor <darius@dons.net.au>
date Wed, 10 Feb 2010 11:33:27 +1030
parents 9da35e705144
children f561c7f130a0
comparison
equal deleted inserted replaced
2:9da35e705144 3:dc5ff2a1ed81
159 if (! config.db_passwd) 159 if (! config.db_passwd)
160 config.db_passwd = ""; 160 config.db_passwd = "";
161 if (! config.db) 161 if (! config.db)
162 config.db = "weather"; 162 config.db = "weather";
163 163
164 #if 0
164 if (! mysql_init (mysql)) 165 if (! mysql_init (mysql))
165 { 166 {
166 fprintf (stderr, "Can't initialize MySQL\n"); 167 fprintf (stderr, "Can't initialize MySQL\n");
167 exit (1); 168 exit (1);
168 } 169 }
242 config.weatherforyou_report_interval = atoi (mysql_row [col++]); /* how many seconds between reports to Weather for you */ 243 config.weatherforyou_report_interval = atoi (mysql_row [col++]); /* how many seconds between reports to Weather for you */
243 config.website_generation_interval = atoi (mysql_row [col++]); /* how many seconds between generating PHP header file */ 244 config.website_generation_interval = atoi (mysql_row [col++]); /* how many seconds between generating PHP header file */
244 config.db_table = mycopy (mysql_row [col++]); /* table */ 245 config.db_table = mycopy (mysql_row [col++]); /* table */
245 config.php_header = mycopy (mysql_row [col++]); /* php header file with weather data */ 246 config.php_header = mycopy (mysql_row [col++]); /* php header file with weather data */
246 config.comparefile = mycopy (mysql_row [col++]); /* file to compare local weather stations */ 247 config.comparefile = mycopy (mysql_row [col++]); /* file to compare local weather stations */
248 #endif
247 return 0; /* success */ 249 return 0; /* success */
248 } 250 }
249 251