2013-07-18 5 views
0

/delta 기능을 사용하여 보관 용 계정에서 변경된 항목이 있는지 찾습니다.보관함 :/델타 및 공유 폴더

처음 실행하면 ('has_more'가 False가 될 때까지) 괜찮습니다. 그러나 이전 호출에서 커서를 사용하여 다시 실행하면 파일 목록이 표시됩니다. 나는 (파일을 변경하지 않고) 다시 실행하고, 파일의 동일한 목록을 얻는다. (변경되지 않았더라도). 나는이 파일들이 공유 폴더에 있다고 생각했다. 나는 그 폴더에있는 새로운 파일 세트로 다시 테스트했고 나는 같은 결과를 얻었다 -이 파일들은 변경되지 않았지만 델타 엔트리에 나타난다.

무엇이 잘못 되었나요?

나는 이것이 버그라고 생각합니다. 주위를 둘러 볼 방법이 있습니까?

편집 : 여기가 self.cursor = delt['cursor']을 사용해야 할 때 코드가 self.cursor = delta['cursor']을 사용처럼 보이는 코드

def getDeltaEntries(self): #this function is a method of a class 
    def _getDelta(): 
     delta = self.client.delta(self.cursor) 
     entries = delta.get('entries') 
     has_more = delta.get('has_more') 
     self.cursor = delta['cursor'] 

     while has_more: 
      delt = self.client.delta(self.cursor) 
      entries.extend(delta.get('entries')) 
      has_more = delt.get('has_more') 
      self.cursor = delta['cursor'] 
     return entries 
    #workaround: query for delta twice and if the result is the same both times, 
    #it implies there's no change 

    ent1 = _getDelta() 
    ent2 = _getDelta() 
    if ent1 == ent2: 
     entries = [] 
    else: 
     entries = ent1 
    return entries 
+0

코드를 추가 할 수 있습니까? – User

+0

정말 도움이되는 코드가 필요합니다. 일반적으로 나는 당신이 묘사하는 행동을 본 적이 없다. – smarx

+0

모든 통화에서 커서가 바뀌고 있습니까? 커서를 각/델타 호출 후 반환 된 것과 함께 업데이트하는 대신 이전 커서를 사용하는 것처럼 들리는 동작을 들려줍니다. – atwyman

답변