Skip to content

Commit

Permalink
clear sqlalchemy session cache
Browse files Browse the repository at this point in the history
  • Loading branch information
SkywalkerSpace committed Sep 7, 2020
1 parent 5b78f08 commit fbcd2f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions seatable_thumbnail/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ def resource_check(self):
workspace_id = self.params['workspace_id']
file_path = self.params['file_path']
size = self.params['size']

session.commit() # clear session cache
workspace = session.query(
Workspaces).filter_by(id=workspace_id).first()
repo_id = workspace.repo_id
Expand Down
2 changes: 1 addition & 1 deletion supervisor.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ directory=/opt/seatable-thumbnail-server/

# Each process needs to have a separate socket file, so we use process_num
# Make sure to update "mysite.asgi" to match your project name
command=/usr/local/bin/uvicorn main:app --host 127.0.0.1 --port 8088 --workers 2 --access-log --proxy-headers
command=/usr/local/bin/uvicorn main:app --host 127.0.0.1 --port 8088 --workers 4 --access-log --proxy-headers

# Automatically start and recover processes
autostart=true
Expand Down

0 comments on commit fbcd2f0

Please sign in to comment.