Changeset d199ced for fedd/fedd.py
- Timestamp:
- Oct 14, 2008 5:35:15 PM (16 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
- Children:
- 3925b50
- Parents:
- 0b466d1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/fedd.py
r0b466d1 rd199ced 20 20 from threading import * 21 21 from signal import signal, pause, SIGINT, SIGTERM 22 from select import select 22 from select import select, error 23 23 from time import sleep 24 24 import logging … … 251 251 """ 252 252 global servers_active, flog 253 253 254 servers_active = False 254 255 flog.info("Received signal %d, shutting down" % sig); … … 267 268 268 269 while servers_active: 269 i, o, e = select((s,), (), (), 5.0) 270 if s in i: s.handle_request() 270 try: 271 i, o, e = select((s,), (), (), 1.0) 272 if s in i: s.handle_request() 273 except error: 274 # The select call seems to get interrupted by signals as well as 275 # the main thread. This essentially ignores signals in this 276 # thread. 277 pass 271 278 272 279 # Done. Remove us from the list … … 356 363 # Main thread waits for signals 357 364 while servers_active: 358 pause()365 sleep(1.0) 359 366 360 367 #Once shutdown starts wait for all the servers to terminate.
Note: See TracChangeset
for help on using the changeset viewer.