Skip to content

Commit

Permalink
fix timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
karacolada committed Apr 29, 2024
1 parent c843a9b commit da42ad3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ server {
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
fastcgi_read_timeout 3600s;
}

location ~ /\.ht {
Expand Down
5 changes: 5 additions & 0 deletions fuji_server/harvester/github_harvester.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import json
import os
import re
import time
from configparser import ConfigParser

from github import Auth, Github
Expand Down Expand Up @@ -77,6 +78,7 @@ def authenticate(self, config):
self.handle = Github(auth=auth)

def harvest(self):
tic = time.perf_counter()
# check if it's a URL or repo ID
# NOTE: this should probably be handled by IdentifierHelper, but I don't understand that module yet.
if self.id.count("/") > 1: # URL
Expand Down Expand Up @@ -127,6 +129,9 @@ def harvest(self):
self.data["source_code_samples"] = source_code_samples

self.retrieve_all(repo)
toc = time.perf_counter()
if self.verbose:
print(f"Harvesting took {toc - tic:.4f} seconds.")

def retrieve_all(self, repo):
file_pattern = r"|".join([rf"(?P<{k}>{'|'.join(v['pattern'])})" for k, v in self.files_map.items()])
Expand Down
1 change: 1 addition & 0 deletions simpleclient/docker/nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ server {
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
fastcgi_read_timeout 3600s;
}

# Specify what happens what .ht files are requested
Expand Down

0 comments on commit da42ad3

Please sign in to comment.