惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Vulnerabilities – Threatpost
U
Unit 42
F
Fortinet All Blogs
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
F
Full Disclosure
月光博客
月光博客
Engineering at Meta
Engineering at Meta
博客园_首页
The Register - Security
The Register - Security
G
Google Developers Blog
The Cloudflare Blog
博客园 - Franky
K
Kaspersky official blog
A
Arctic Wolf
Scott Helme
Scott Helme
C
Cisco Blogs
Hugging Face - Blog
Hugging Face - Blog
C
Check Point Blog
NISL@THU
NISL@THU
AI
AI
D
DataBreaches.Net
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Stack Overflow Blog
Stack Overflow Blog
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
Vercel News
Vercel News
T
Tor Project blog
P
Privacy International News Feed
D
Docker
I
Intezer
L
LangChain Blog
P
Proofpoint News Feed
Security Latest
Security Latest
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
博客园 - 聂微东
AWS News Blog
AWS News Blog
Martin Fowler
Martin Fowler
P
Privacy & Cybersecurity Law Blog
V
V2EX
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
The Hacker News
The Hacker News
T
Tenable Blog
Blog — PlanetScale
Blog — PlanetScale
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog

博客园 - 岌岌可危

免费的打印管理软件easyjen 书籍链接 CrowdStrike引起的一次失败又成功的故障恢复 简单四则运算器 作业之打印金字塔 方差计算,使用类和常规方式 python作业 简单java servlet的登录脚本,部署到docker 如何在Windows Server 2016上重置用户“管理员”的密码 sublimeCodeIntel在windows下安装的坑 python pip安装失败 如何创建和编译动态链接库并且在另一应用程序中调用它。 Visual Studio2019 cannot open source Django创建模型。 Django创建视图 Django创建项目和应用 无Admin权限安装python 嵌入版本和PIP,并安装Django python,Django安装在windows上 一段代码实现RPC DCOM和RPC,两者的认证过程有什么区别?
huey在windows下使用的坑
岌岌可危 · 2022-09-26 · via 博客园 - 岌岌可危

在windows上使用huey会有坑如下。

redis,phthon环境已经安装好。

安装好huey后,使用如下实例:

1.demo.py 任务worker文件,简单的加法

from config import huey

@huey.task()
def add(a, b):
return a + b

2.直接运行worker

python huey_consumer.py -w 1 -k process demo.huey

使用process模型就会报错

C:\Users\prokher\Desktop\HueyTest>huey_consumer.py -w 1 -k process main.huey
[2017-03-11 00:30:20,280] INFO:huey.consumer:2688:Huey consumer started with 1 process, PID 2688
[2017-03-11 00:30:20,280] INFO:huey.consumer:2688:Scheduler runs every 1 seconds.
[2017-03-11 00:30:20,280] INFO:huey.consumer:2688:Periodic tasks are enabled.
[2017-03-11 00:30:20,295] INFO:huey.consumer:2688:The following commands are available:
+ count_beans
Traceback (most recent call last):
  File "C:\Program Files\Python36\Scripts\huey_consumer.py", line 49, in <module>
    consumer_main()
  File "C:\Program Files\Python36\Scripts\huey_consumer.py", line 45, in consumer_main
    consumer.run()
  File "c:\program files\python36\lib\site-packages\huey\consumer.py", line 439, in run
    self.start()
  File "c:\program files\python36\lib\site-packages\huey\consumer.py", line 430, in start
    self.scheduler.start()
  File "c:\program files\python36\lib\multiprocessing\process.py", line 105, in start
    self._popen = self._Popen(self)
  File "c:\program files\python36\lib\multiprocessing\context.py", line 223, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "c:\program files\python36\lib\multiprocessing\context.py", line 322, in _Popen
    return Popen(process_obj)
  File "c:\program files\python36\lib\multiprocessing\popen_spawn_win32.py", line 65, in __init__
    reduction.dump(process_obj, to_child)
  File "c:\program files\python36\lib\multiprocessing\reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'Consumer._create_process.<locals>._run'

C:\Users\prokher\Desktop\HueyTest>Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\program files\python36\lib\multiprocessing\spawn.py", line 99, in spawn_main
    new_handle = reduction.steal_handle(parent_pid, pipe_handle)
  File "c:\program files\python36\lib\multiprocessing\reduction.py", line 82, in steal_handle
    _winapi.PROCESS_DUP_HANDLE, False, source_pid)
OSError: [WinError 87] The parameter is incorrect
3. git上已经有报告
https://github.com/coleifer/huey/issues/208

4.如果使用thread方式则没有问题

python huey_consumer.py -w 2 -k thread demo.huey