Skip to content

running Thread object cause twice running #5307

@SigmaStar

Description

@SigmaStar

following code cause MyThread object running twice.

import threading
import time
from flask import Flask

class MyThread(threading.Thread):
    def __init__(self):
        super().__init__()
        self.event = threading.Event()

    def run(self):
        print("Hello")


app = Flask(__name__)
t1 = MyThread()
t1.start()
app.run(host='0.0.0.0', port = 19001, debug = True)

set debug as False can avoid this problem but why is that? Is that a feature?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions