예제 #1
0
 def get_last_refresh(self, dashboard_item: Insight):
     result = self.get_result(dashboard_item)
     if result is not None:
         return dashboard_item.last_refresh
     dashboard_item.last_refresh = None
     dashboard_item.save()
     return None
예제 #2
0
    def get_last_refresh(self, insight: Insight):
        if self.context["request"].GET.get("refresh"):
            return now()

        result = self.get_result(insight)
        if result is not None:
            return insight.last_refresh
        insight.last_refresh = None
        insight.save()
        return None
예제 #3
0
파일: insight.py 프로젝트: PostHog/posthog
    def get_last_refresh(self, insight: Insight):
        if should_refresh(self.context["request"]):
            return now()

        result = self.get_result(insight)
        if result is not None:
            return insight.last_refresh
        if insight.last_refresh is not None:
            # Update last_refresh without updating "updated_at" (insight edit date)
            insight.last_refresh = None
            insight.save()
        return None