Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6216123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:10:41+00:00 2026-05-24T07:10:41+00:00

My GAE application should upload several files to another server (with urlfetch usage). How

  • 0

My GAE application should upload several files to another server (with urlfetch usage).
How to implement this with tasks with assumption that at the end of last task completion I should perform one more action?

How can I know when the last task is completed?

Upd. Is the following approach with Tasks correct?

class Accumulator(db.Model):
    counter = db.IntegerProperty()

def increase_counter(key):
    obj = db.get(key)
    obj.counter += 1
    obj.put()

def zero_counter(key):
    obj = db.get(key)
    obj.counter = 0
    obj.put()

def decrease_counter(key):
    obj = db.get(key)
    obj.counter -= 1
    obj.put()

def get_counter(key):
    obj = db.get(key)
    return obj.counter

class PublishPhotosHandler(webapp.RequestHandler):
    # where this tasks_counter should be defined? seems not here
    db.run_in_transaction(zero_counter, some_unique_key)
    for argument in files_arguments:
        taskqueue.add(url='/upload', params={'key': key})
        db.run_in_transaction(increase_counter, some_unique_key)

    # here we redirect user to another page '/checkstatus'
    ...
    # nothing is shown to the user here

class UploadWorker(webapp.RequestHandler):
    def post(self):
        key = self.request.get('key')
        result = urlfetch.fetch(...)
        db.run_in_transaction(decrease_counter, some_unique_key)
        # how to return there error, so the task will be retried?
        # nothing is shown to the user here

# this is our '/checkstatus' page
class CheckStatus(webapp.RequestHandler):
    def get(self, key):
        if get_counter(some_unique_key) == 0:
            # all tasks finished
            # show the content
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T07:10:41+00:00Added an answer on May 24, 2026 at 7:10 am

    You can make an counter entity, that stores current count of tasks to execute. And each task. after finish, must decrease value of this counter, in transaction. If it becomes 0, then it’s last action, just finished.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My GAE application receives several files in the upload (can be from 0 to
I want to develop a GAE application using python, but I fear that Google
I'm building application with GWT + GAE on my MAC. In this app i
I'm working on an iPhone application that should work in offline and online modes.
I have made my GAE application using the development server, but now when I
I successfully did an application that uses Flex as a client as GAE as
I have a super-trivial application on GAE that I want to upgrade to HRD
I have a GAE application that is mapped to a subdomain on a custom
I am playing with GAE and made a very compact application that gets tiny
I'm currently writing an Android application that should be able to receive push notifications

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.