我有一个脚本,可以将广告,关键字,negativeKeywords,附加链接,标注,发货从主帐户复制到从属帐户 一切正常。但是当我在奴隶帐户中创建关键字时,会收到错误消息 [CONCURRENT_MODIFICATION:DatabaseError.CONCURRENT_MODIFICATION:]
最奇怪的是,从脚本的10个执行中可以执行5个无任何错误,而有5个有错误
function copyKeywords(slaveGroup, masterKeywordsData, replicationSettings) {
var count = Object.keys(masterKeywordsData).length;
l('Copying %s keywords...', count);
for (var i = 0; i < count; i++) {
var key = Object.keys(masterKeywordsData)[i];
var masterKeywordData = masterKeywordsData[key];
log('%s/%s - Replicating keyword %s...', (parseInt(i) + 1), count, masterKeywordData.id);
log('Keyword data: %s', JSON.stringify(masterKeywordData));
var slaveKeyword = null;
var finalUrl = null;
if(masterKeywordData.finalUrl) {
finalUrl = formateUrl(masterKeywordData.finalUrl, replicationSettings);
}
slaveKeyword = slaveGroup
.newKeywordBuilder()
.withText(masterKeywordData.text);
if(finalUrl) {
slaveKeyword = slaveKeyword
.withFinalUrl(finalUrl);
}
slaveKeyword = slaveKeyword
.build();
if (slaveKeyword == null) {
log('Nothing was replicated');
} else {
if (slaveKeyword.isSuccessful()) {
log('Keyword %s successfuly replicated', masterKeywordData.id);
} else {
log(slaveKeyword.getErrors());
error('Cannot replicate keyword %s ', masterKeywordData.id);
}
}
sleep(2000);
}
}
睡眠时间为2000毫秒,因此我很少收到错误消息。但有时会发生( 有人知道我为什么收到关于以下内容的错误吗? [CONCURRENT_MODIFICATION:DatabaseError.CONCURRENT_MODIFICATION:] 因为我没有做任何修改