Software / code / prosody
Comparison
prosodyctl @ 1459:545208bc0e84
prosodyctl: Use prosodyctl_timeout option if it exists in the config
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Thu, 02 Jul 2009 04:53:31 +0100 |
| parent | 1458:fce75b4efda9 |
| child | 1460:5882ed6219ff |
comparison
equal
deleted
inserted
replaced
| 1458:fce75b4efda9 | 1459:545208bc0e84 |
|---|---|
| 162 break; | 162 break; |
| 163 end | 163 end |
| 164 end | 164 end |
| 165 return password; | 165 return password; |
| 166 end | 166 end |
| 167 | |
| 168 local prosodyctl_timeout = (config.get("*", "core", "prosodyctl_timeout") or 5) * 2; | |
| 167 ----------------------- | 169 ----------------------- |
| 168 local commands = {}; | 170 local commands = {}; |
| 169 local command = arg[1]; | 171 local command = arg[1]; |
| 170 | 172 |
| 171 function commands.adduser(arg) | 173 function commands.adduser(arg) |
| 298 local ok, running = prosodyctl.isrunning(); | 300 local ok, running = prosodyctl.isrunning(); |
| 299 if ok and running then | 301 if ok and running then |
| 300 break; | 302 break; |
| 301 elseif i == 5 then | 303 elseif i == 5 then |
| 302 show_message("Still waiting..."); | 304 show_message("Still waiting..."); |
| 303 elseif i >= 10 then | 305 elseif i >= prosodyctl_timeout then |
| 304 show_message("Prosody is still not running. Please give it some time or check your log files for errors."); | 306 show_message("Prosody is still not running. Please give it some time or check your log files for errors."); |
| 305 return 2; | 307 return 2; |
| 306 end | 308 end |
| 307 socket.sleep(0.5); | 309 socket.sleep(0.5); |
| 308 i = i + 1; | 310 i = i + 1; |
| 368 local ok, running = prosodyctl.isrunning(); | 370 local ok, running = prosodyctl.isrunning(); |
| 369 if ok and not running then | 371 if ok and not running then |
| 370 break; | 372 break; |
| 371 elseif i == 5 then | 373 elseif i == 5 then |
| 372 show_message("Still waiting..."); | 374 show_message("Still waiting..."); |
| 373 elseif i >= 10 then | 375 elseif i >= prosodyctl_timeout then |
| 374 show_message("Prosody is still running. Please give it some time or check your log files for errors."); | 376 show_message("Prosody is still running. Please give it some time or check your log files for errors."); |
| 375 return 2; | 377 return 2; |
| 376 end | 378 end |
| 377 socket.sleep(0.5); | 379 socket.sleep(0.5); |
| 378 i = i + 1; | 380 i = i + 1; |