1

I am doing this using Django / GAE / Python environment:

cron:
    #run events every 12 hours

and

def events(request):
    # read all records 
    # Do some processing on a few records

   return http.HTTPResponseGone('Some Records are modified' )

Result in production : Job runs on time with 'failed' message However, it has done the job exactly on the datastore as required No error log entry seen Dev : No errors ; returns the message 'Some Records are modified'

Is it possible to avoid HTTP Response returned ? There is no need for HTTPResponse for me, however, I have kept this as Dev server testing fails in its absence. Can some one help me to make the code clean?

Reese Moore
  • 11,524
  • 3
  • 24
  • 32

1 Answers1

2

Gone is error 410. You should return 200 Success if the operation succeeds. When you return HttpResponse, the default status is 200.

Matthew Flaschen
  • 278,309
  • 50
  • 514
  • 539
  • Is it possible to completely remove the return statement. In a cron job, it is not making any sense. I have kept this for the sake of matching with request ? – Sharma Anil Nov 27 '10 at 09:05
  • @Sharma, App Engine cron jobs are just HTTP requests, and every HTTP request needs a HTTP response. – Matthew Flaschen Nov 27 '10 at 09:11
  • Thanks. I understand the change I need to make would be return http.HTTPResponse(). Will give a try and see what happen in production – Sharma Anil Nov 27 '10 at 09:28