宝宝巴士游戏大全出现already executing怎么解决

Cancel an already executing task with Celery?
由 administrator
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):问题:
I have been reading the doc and searching but cannot seem to find a straight answer:
Can you cancel an already executing task? (as in the task has started, takes a while, and half way through it needs to be cancelled)
I found this from the doc at
>>> result = add.apply_async(args=[2, 2], countdown=120)
>>> result.revoke()
But I am unclear if this will cancel queued tasks or if it will kill a running process on a worker.
Thanks for any light you can shed!
revoke cancels the task execution. If a task is revoked, the workers ignore the task and do not execute it. If you don't use persistent revokes your task can be executed after worker's restart.
revoke has an terminate option which is False by default. If you need to kill the executing task you need to set terminate to True.
>>> from celery.task.control import revoke
>>> revoke(task_id, terminate=True)
In Celery 3.1, the
is changed.
According to the , you should use result.revoke:
>>> result = add.apply_async(args=[2, 2], countdown=120)
>>> result.revoke()
or if you only have the task id:
>>> from proj.celery import app
>>> app.control.revoke(task_id)
@0x00mh's answer is correct, however recent celery
say that using the terminate option is "a last resort for administrators" because you may accidentally terminate another task which started executing in the meantime. Possibly a better solution is combining terminate=True with signal='SIGUSR1' (which causes the SoftTimeLimitExceeded exception to be raised in the task).
See the following options for tasks: ,
(or you can set it for workers). If you want to control not only time of execution, then see
argument of apply_async method.
添加新评论如何解决java.lang.IllegalStateException:getAttribute: Session already invalidated这个问题啊
[问题点数:20分,结帖人zoo8o8o8]
本版专家分:75
结帖率 100%
CSDN今日推荐
本版专家分:1841
本版专家分:742
本版专家分:59
本版专家分:0
匿名用户不能发表回复!|
其他相关推荐gamguard is already running try rebooting first and executing the game again. 是什么意思_百度知道
gamguard is already running try rebooting first and executing the game again. 是什么意思
我登陆游戏后就出现这些英文,又不知道怎么回事,写什么,所以请高人翻译一下.
我有更好的答案
已经开始尝试重新启动gamguard第一和执行游戏了
采纳率:64%
游戏的屏蔽系统正在运行,先尝试重新启动,在运行该游戏。
为您推荐:
其他类似问题
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。在 SegmentFault,学习技能、解决问题
每个月,我们帮助 1000 万的开发者解决各种各样的技术问题。并助力他们在技术能力、职业生涯、影响力上获得提升。
问题对人有帮助,内容完整,我也想知道答案
问题没有实际价值,缺少关键内容,没有改进余地
在多Fragment 切换时报了这个异常, google 搜了一些答案都没能解决这个问题.app 布局是这样的:刚开始是一个Fragment,里面有 viewpager ,viewpager 里面有三个 fragment, 然后是侧滑导航栏可切换到其他的 Fragment 但切换回来第一个界面的时候报了这个错误,不知道是布局的问题还是什么问题...是因为用了 v4 包的 Fragment 吗?看别人没用 v4包的 Fragment 不会报错,求解~
java.lang.IllegalStateException: FragmentManager is already executing transactions
at android.support.v4.app.FragmentManagerImpl.execSingleAction(FragmentManager.java:1631)
at android.support.v4.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:679)
at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:143)
at android.support.v4.view.ViewPager.populate(ViewPager.java:1272)
at android.support.v4.view.ViewPager.populate(ViewPager.java:1120)
at android.support.v4.view.ViewPager.setOffscreenPageLimit(ViewPager.java:884)
at com.muxistudio.jobs.ui.find.FindFragment.setupViewPager(FindFragment.java:69)
at com.muxistudio.jobs.ui.find.FindFragment.initView(FindFragment.java:43)
at com.muxistudio.jobs.ui.BaseFragment.onViewCreated(BaseFragment.java:42)
at com.muxistudio.jobs.ui.find.FindFragment.onViewCreated(FindFragment.java:75)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1132)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1295)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:801)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1682)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:541)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
第一个界面的 Fragment 中添加子 Fragment(在第二次切换到这个界面执行 mViewPager.setOffscreenPageLimit(2); 时抛出了这个异常)
for (int i = 0; i & 3; i++) {
mTabLayout.addTab(mTabLayout.newTab().setText(titleList.get(i)));
mTabLayout.setBackgroundColor(Color.WHITE);
mTabLayout.setTabTextColors(Color.BLACK, getResources().getColor(R.color.colorAccent));
List&Fragment& fragments = new ArrayList&&();
fragments.add(InfoFragment.newInstance(1));
fragments.add(InfoFragment.newInstance(2));
fragments.add(InfoFragment.newInstance(3));
FragmentAdapter adapter =
new FragmentAdapter(getActivity().getSupportFragmentManager(), fragments, titleList);
mViewPager.setAdapter(adapter);
mViewPager.setOffscreenPageLimit(2);
mTabLayout.setupWithViewPager(mViewPager);
切换 fragment
@Override public void showFragment(Fragment fragment) {
getSupportFragmentManager().beginTransaction().replace(R.id.content, fragment).commit();
Logger.d((fragment instanceof FindFragment) + "");
if (fragment instanceof FindFragment) {
invalidateOptionsMenu();
OnNavigationItemClick(mMainView是MainActivity实现的一个接口对象,用了 MVP,来回切换就会报这个异常...)
@Override public void onNavigationItemClick(MenuItem item) {
switch (item.getItemId()){
case R.id.action_find:
mMainView.showFragment(FindFragment.newInstance());
case R.id.action_date:
case R.id.action_person:
mMainView.showFragment(CollectionFragment.newInstance());
case R.id.action_discuss:
case R.id.action_setting:
mMainView.showSetting();
case R.id.action_about:
mMainView.setTitle(item.getTitle().toString());
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
解决了,我这个问题放了几天后来去搜Stack OverFlow时发现有个回答解决了我的问题
FragmentAdapter adapter =
new FragmentAdapter(getActivity().getSupportFragmentManager(), fragments, titleList);
FragmentAdapter adapter = new FragmentAdapter(getChildFragmentManager(),fragments,titleList);
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
楼主解决问题了没有,我和你遇到了一样的问题。
同步到新浪微博
分享到微博?
关闭理由:
删除理由:
忽略理由:
推广(招聘、广告、SEO 等)方面的内容
与已有问题重复(请编辑该提问指向已有相同问题)
答非所问,不符合答题要求
宜作评论而非答案
带有人身攻击、辱骂、仇恨等违反条款的内容
无法获得确切结果的问题
非开发直接相关的问题
非技术提问的讨论型问题
其他原因(请补充说明)
我要该,理由是:
在 SegmentFault,学习技能、解决问题
每个月,我们帮助 1000 万的开发者解决各种各样的技术问题。并助力他们在技术能力、职业生涯、影响力上获得提升。好崇拜那些大牛啊~
java.lang.IllegalStateException: FragmentManager is already executing transactions解决方法
今天在写一个Fragement中嵌套Fragement的时候,出现了 java.lang.IllegalStateException: FragmentManager is already executing transactions这个异常,说是FragmentManager已经执行了transaction,那既然已经执行了怎么办呢?
于是想到Context.getSupportFragmentManager()这个应该是只适用于管理Activity中的Fragment。
在网上找了一下,很多标题一样但是跟这个都没什么关系。后来看到一篇,发现确实是如我想的那样子,不能继续使用Context.getSupportFragmentManager()或者Context.getFragment()来创建FragementManager对象了,要用到getChildFragmentManager(),改正之后就可以了!
没有更多推荐了,}

我要回帖

更多关于 宝宝巴士游戏大全 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信