dispatch.yaml并不总是路由延迟任务队列来纠正模块

时间:2015-05-13 07:56:58

标签: python google-app-engine task-queue deferred-execution gae-module

我有一个dispatch.yaml文件,它应该将/_ah/queue/deferred路径上的延迟任务队列请求路由到具有更多内存的模块实例。但是,请求不会一直被路由。

请参阅此doc page for a primer on deferred tasks(它们是任务队列任务的子类型)。

这是我的dispatch.yaml

dispatch:
- url: "*/_ah/queue/deferred"
  module: deferred

- url: "*/cron/*"
  module: deferred

- url: "*/ocr/cron/*"
  module: deferred

问题在于,虽然上述调度文件似乎在大多数时间都有效,但它并不是一直有效。也就是说,有时/_ah/queue/deferred上的请求会被路由到默认模块而不是延迟模块。

截图

以下是关于"延期"的日志的屏幕截图模块。请注意,已正确分派延迟路径的URL:

Image of Deferred Module

但这是默认模块日志的屏幕截图。请注意,它也是将此路径路由到它: Image of Default Module

1 个答案:

答案 0 :(得分:2)

我猜您忘了添加 playerNode = SKSpriteNode(imageNamed: "spaceshipv2") playerNode!.physicsBody = SKPhysicsBody(texture: playerNode!.texture, size: playerNode!.size); playerNode!.xScale = 0.5 playerNode!.yScale = 0.5 playerNode!.position = CGPoint(x: size.width / 2.0, y: 220.0) playerNode!.physicsBody!.linearDamping = 1.0 playerNode!.physicsBody!.allowsRotation = false playerNode!.physicsBody?.affectedByGravity = false playerNode!.physicsBody!.categoryBitMask = CollisionCategoryPlayer playerNode!.physicsBody!.contactTestBitMask = CollisionCategoryAsteroids playerNode!.name = "Player" //addChild(playerNode!) foregroundNode!.addChild(playerNode!)

    func didBeginContact(contact: SKPhysicsContact) {

        var nodeB = contact.bodyB!.node!

        if nodeB.name == "Asteroid"  {

            println("Touched")
            nodeB.removeFromParent()
        }

    }

更多信息 https://cloud.google.com/appengine/docs/python/config/queue#target

相关问题 GAE backend instance with deferred