I want to save the file in a separate process. Is it safe? After all, there should not be the same problems as with multithreading, right?
from multiprocessing import Process def update(self, request): uid = str(uuid.uuid4()) Process(target=self.save_file, args=(uid, request)).start() return uid
loggingby default can work with multiple threads . But in order to write to several logs from several processes , additional synchronization is required. Check out the documentation for multiple single file processes - jfs