-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
18284 Add pre-fork server hook to gunicorn config
- Loading branch information
Showing
2 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
import time | ||
|
||
|
||
def pre_fork(server, worker): | ||
# Delay loading of each worker by 5 seconds | ||
# This is done to work around an issue where the Traction API is returning an invalid token. The issue happens | ||
# when successive token retrieval calls are made with less than 2-3 seconds between the calls. | ||
time.sleep(5) | ||
|
||
|
||
pre_fork = pre_fork |