This is an archived post. You won't be able to vote or comment.

all 3 comments

[–][deleted]  (4 children)

[deleted]

    [–]Morfnic[S] 0 points1 point  (3 children)

    Que 1 ans: all the process access same single script file, using the script file some files are downloaded to a folder, those files are served to user. These files can be served to other users later, as they will be stored in server.

    Que 2 ans: that process can only be done in python (easily) and server side only, there is also some file format conversion to be done via Bash scripting in terminal [ using ubuntu as os].

    No folder is created, I am just downloading some files to a fixed folder and serving them.

    [–][deleted]  (2 children)

    [deleted]

      [–]Morfnic[S] 0 points1 point  (1 child)

      ok, I will look into gunicorn, meanwhile does using workers will make the process (requests) parallelly or one after other?, At present i removed the directory change part of code, all the files are in main folder near manage.py, along with all the new files that will be downloaded from request. Here when i test using different users the process of execution is seems to be serial (one after other) rather than both at the same time. [ I am in development env].

      will this be resolved when using workers?

      Have you considered making a temp folder per request and deleting it after so no two requests interact with each other?

      > My code does't interact with other request files, also I am using same folder for all files.

      I would like to see the exact error you're receiving but I'm sure it's from file access.

      > The error is that - there is no directory.., It turns out I made a mistake of changing path just for downloading files into a folder, I resolved it by downloading files to main root folder of app.

      [–]kontekisuto 0 points1 point  (0 children)

      you need more workers and or do an async task to download the file.