Вопрос

Due to the limitations of the lbapi as detailed here, my queries to the lbapi have drastically increased in size (I am passing an array of "visible" projects to the LBAPI which will only return work items from projects which I have view access to) to the point where I get a "Request entity too large" error.

I know I need to break up my queries by only using some of the visible projectsat a time. I wanted to do this programatically - for every 100 visible projects, do a query, take the records that come back and throw them into an array.

However, this gets kind of messy when I am trying to determine when to continue - have all of the queries come back and populated the array of totals? Can anyone think of a clean way to make this happen?

for (var i = 0; i < Math.ceil(App.visibleTeams.length / 100); i++) {
    console.log('i',i);
    var tempProj = [];
    for (var j = i * 100; j < Math.min((i + 1) * 100, App.visibleTeams.length); j++) {
        tempProj.push(App.visibleTeams[j]);
    }
    console.log('tempProj.length',tempProj.length);
    // query
    App.completeRecords = [];
    Ext.create('Rally.data.lookback.SnapshotStore', {
        pageSize : 10000,
        fetch    : ['Parent','Name','_UnformattedID','PortfolioItemType','PercentDoneByStoryPlanEstimate','ObjectID','PlannedStartDate','PlannedEndDate','ActualStartDate','ActualEndDate','LeafStoryPlanEstimateTotal'],
        filters  : [{
            property : '__At',
            value    : 'current'
        },{
            property : '_TypeHierarchy',
            value    : 'PortfolioItem'
        },{
            property : '_ItemHierarchy',
            operator : 'in',
            value    : node.ObjectID
        },{
            property : 'Project',
            operator : 'in',
            value    : tempProj
        },{
            property : 'LeafStoryPlanEstimateTotal',
            operator : '>',
            value    : 0
        }]
    }).load({
        callback: function(records, operation, success) {
            if (!success) {
                Ext.getBody().unmask();
                Ext.Msg.alert('Error ' + operation.error.status + ': ' + operation.error.statusText, operation.error.errors[0]);
            } else {
                App.completeRecords.push.apply(App.completeRecords, records);
                // if done, callback(), else, do nothing
            }
        }
    });
}
Это было полезно?

Решение

We added some new functionality that will address this. I added a more detailed response to the other question that you referenced.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top