Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Typo]: HTAP应用中"交易及分析"章节代码有遗漏 #1171

Closed
1 task done
aronchanisme opened this issue Dec 4, 2024 · 0 comments
Closed
1 task done

[Typo]: HTAP应用中"交易及分析"章节代码有遗漏 #1171

aronchanisme opened this issue Dec 4, 2024 · 0 comments

Comments

@aronchanisme
Copy link

Is there an existing issue about this typo?

  • I have checked the existing issues.

Describe the issue

https://docs.matrixorigin.cn/v24.2.0.0/MatrixOne/Tutorial/htap-demo/#_10
原来的代码

    pool = create_connection_pool()
    if pool:
        # 创建多个线程
        threads = []
        for _ in range(5):  # 创建 5 个线程
            thread = threading.Thread(target=insert_transactions, args=(pool,))
            threads.append(thread)
            thread.start()
        for thread in threads:
            thread.join()  # 等待所有线程完成
        analyze_transactions(pool)

正确的代码

import threading
def thread_insert():
    pool = create_connection_pool()
    if pool:
        # 创建多个线程
        threads = []
        for _ in range(5):  # 创建 5 个线程
            thread = threading.Thread(target=insert_transactions, args=(pool,))
            threads.append(thread)
            thread.start()
        for thread in threads:
            thread.join()  # 等待所有线程完成
        analyze_transactions(pool)

主要的区别在于少了两行关键的依赖模块和函数定义说明

import threading
def thread_insert():
@yangj1211 yangj1211 mentioned this issue Dec 5, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants