Reputation: 11317
public class BackupMaker
{
public BackupMaker(String task_handler_url, String task_queue_name,
String task_name)
{
final Queue q = (task_queue_name == null) ? QueueFactory
.getDefaultQueue() : QueueFactory.getQueue(task_queue_name);
final TaskOptions task = TaskOptions.Builder.withUrl(task_handler_url)
.taskName(task_name);
q.add(task);
}
}
..............
public class BackupMakerTaskEntry extends HttpServlet
{
private static final long serialVersionUID = 1L;
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Task is running !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
res.getWriter().print("hello!");
}
}
..............
private void create_backup_task()
{
final String task_handler_url = "/data_backup/task_entry";
final String task_queue_name = null; // Use 'Default' queue.
final String task_name = "Test";
new BackupMaker(task_handler_url, task_queue_name, task_name);
}
The code above will create a google task app.
Problem is, the task is never being executed, on the dev server of GAE.
After adding the task, re-adding it gives an exception 'TaskAlreadyExistsException', which means the task is being added but simply won't fire.
I'm on Win7 64bit Eclipse Indigo (4.7) JDK 6u26 and newest GAE+GWT plugin/lib for Eclipse.
Any idea? Does it happen to me only?
Upvotes: 0
Views: 645
Reputation: 2415
As I remember in dev environment you have to run tasks manually from app console. They don't run automatically.
Upvotes: 3