MCPcopy
hub / github.com/benoitc/gunicorn / _cleanup_sync

Method _cleanup_sync

gunicorn/dirty/arbiter.py:1128–1152  ·  view source on GitHub ↗

Synchronous cleanup on exit.

(self)

Source from the content-addressed store, hash-verified

1126 self.reap_workers()
1127
1128 def _cleanup_sync(self):
1129 """Synchronous cleanup on exit."""
1130 # Remove PID file
1131 if self.pidfile and os.path.exists(self.pidfile):
1132 try:
1133 os.unlink(self.pidfile)
1134 except OSError:
1135 pass
1136
1137 # Clean up socket
1138 if os.path.exists(self.socket_path):
1139 try:
1140 os.unlink(self.socket_path)
1141 except OSError:
1142 pass
1143
1144 # Clean up temp directory
1145 try:
1146 for f in os.listdir(self.tmpdir):
1147 os.unlink(os.path.join(self.tmpdir, f))
1148 os.rmdir(self.tmpdir)
1149 except OSError:
1150 pass
1151
1152 self.log.info("Dirty arbiter exiting (pid: %s)", self.pid)

Calls 3

existsMethod · 0.80
unlinkMethod · 0.80
infoMethod · 0.45