1

So I have a little bit of a dilemma in trying to obtain the oldest task of a user. I’m able to get the oldest task of each user in my team's workspace, but takes 1 hour and 30 minutes to run.

Here's the current workflow that I have currently:

1) Get all users and store in a users var.
2) Iterate through all users.
3) For each user, grab all tasks and store in a tasks var.
4) Iterate through all tasks, compare task.modified_at attribute to oldest_task var, store in oldest_task if task.modified_at is older.

What's taking so long is the loading of and iterating through each user's tasks. Any ideas on how to make this process faster? Would there potentially be a way to query specifically for the oldest task of a user through the API?

I’m building a tool that will track the age of the oldest task for each user for tracking purposes. I would love to find out if there’s something that I’m missing.

4

1 回答 1

1

对于最旧的任务,您可能应该使用 created_at 而不是 modified_at (毕竟最旧的任务可能最近被修改过)。

我们没有任何方法在 API 中专门获取较旧的任务,或按创建时间排序或类似的东西,所以现在你的解决方法实际上是唯一的方法。您可以通过?opt_fields=created_at在任务查询中使用来减少您正在加载的数据量,从而加快速度。

于 2015-07-07T13:33:30.197 回答