mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 22:40:29 +03:00
'import resource' only where its used, Windows does not have it
This commit is contained in:
parent
36849b2fba
commit
1300771bad
1 changed files with 16 additions and 12 deletions
|
|
@ -23,7 +23,6 @@ import glob
|
||||||
import subprocess
|
import subprocess
|
||||||
import posixpath
|
import posixpath
|
||||||
import re
|
import re
|
||||||
import resource
|
|
||||||
import sys
|
import sys
|
||||||
import tarfile
|
import tarfile
|
||||||
import threading
|
import threading
|
||||||
|
|
@ -1026,6 +1025,9 @@ def main():
|
||||||
raise FDroidException("No apps to process.")
|
raise FDroidException("No apps to process.")
|
||||||
|
|
||||||
# make sure enough open files are allowed to process everything
|
# make sure enough open files are allowed to process everything
|
||||||
|
try:
|
||||||
|
import resource # not available on Windows
|
||||||
|
|
||||||
soft, hard = resource.getrlimit(resource.RLIMIT_NOFILE)
|
soft, hard = resource.getrlimit(resource.RLIMIT_NOFILE)
|
||||||
if len(apps) > soft:
|
if len(apps) > soft:
|
||||||
try:
|
try:
|
||||||
|
|
@ -1037,6 +1039,8 @@ def main():
|
||||||
.format(integer=soft))
|
.format(integer=soft))
|
||||||
except (OSError, ValueError) as e:
|
except (OSError, ValueError) as e:
|
||||||
logging.warning(_('Setting open file limit failed: ') + str(e))
|
logging.warning(_('Setting open file limit failed: ') + str(e))
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
if options.latest:
|
if options.latest:
|
||||||
for app in apps.values():
|
for app in apps.values():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue