Skip to content

request.POST.copy() 非安全線程? #90

@talent881

Description

@talent881

views.py

    @expose('/to_save')
    def to_save(self):
        POST01 = request.POST.copy()
        self._to_save_sub()

    def _to_save_sub(self):
        POST02 = request.POST.copy()

程式碼是以上這樣。
以每秒 POST 10 筆不同數據的方式做測試, 在同一線程(Thread-1) POST01 得到的數據和 POST02 得到的數據有機會是不同的數據。

這會有什麼解決方法?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions