2016-08-18 1 views
0

vsivsi:job-collectionで、the exampleのようなジョブを設定しましたが、違いは自分のジョブがサーバー上で処理されていることです。クライアント上のジョブを処理するサンプルアプリケーションと比べて、何が欠けているのかわかりません。メトリジョブコレクションでリモートジョブが実行されていない

lib/db.coffee

@ParsingJobs = JobCollection('parsing', { 
    workTimeout: 10000 
    transform: (d) -> 
     try 
      res = new Job(ParsingJobs, d) 
     catch e 
      res = d 
     return res 
}) 

if Meteor.isServer 
    Meteor.startup(-> 
     ParsingJobs.allow({ 
      admin: (user_id, method, params) -> 
       # commented temporarily Roles.userIsInRole(Meteor.user(), ['admin']) 
       true 
     }) 

     ParsingJobs.startJobServer() 

server.coffee

que = ParsingJobs.processJobs('parsing', {workTimeout: 10000}, (job, cb) -> 
    # do some processing 
    job.done('success') 
    cb() 

ParsingJobs.find({type: 'parsing', status: 'ready'}).observe 
    added: -> 
     que.trigger() 

On the client I can just run a shell command:

x = ParsingJobs.find().fetch()[0] 
x.rerun() 

結果:

job_class.js:16 Uncaught Error: Job remote method call error, no valid invocation method found.

は私が間違って何をしているのですか?

答えて

1

変更この行:これまで

que = ParsingJobs.processJobs('parsing', {workTimeout: 10000}, (job, cb) -> 

que = Job.processJobs('parsing', {workTimeout: 10000}, (job, cb) -> 
関連する問題