~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/scripts/garbo.py

  • Committer: Stuart Bishop
  • Date: 2011-07-29 11:11:06 UTC
  • mto: (8758.7.1 garbo-bulk-pruner)
  • mto: This revision was merged to the branch mainline in revision 13926.
  • Revision ID: stuart.bishop@canonical.com-20110729111106-h63agoq0s5hcvp62
Add garbo-frequently

Show diffs side-by-side

added added

removed removed

Lines of Context:
1073
1073
                transaction.abort()
1074
1074
 
1075
1075
 
 
1076
class FrequentDatabaseGarbageCollector(BaseDatabaseGarbageCollector):
 
1077
    """Run every 5 minutes.
 
1078
 
 
1079
    This may become even more frequent in the future.
 
1080
 
 
1081
    Jobs with low overhead can go here to distribute work more evenly.
 
1082
    """
 
1083
    script_name = 'garbo-frequently'
 
1084
    tunable_loops = [
 
1085
        OAuthNoncePruner,
 
1086
        OpenIDConsumerNoncePruner,
 
1087
        OpenIDConsumerAssociationPruner,
 
1088
        ]
 
1089
    experimental_tunable_loops = []
 
1090
 
 
1091
    # 5 minmutes minus 20 seconds for cleanup. This helps ensure the
 
1092
    # script is fully terminated before the next scheduled hourly run
 
1093
    # kicks in.
 
1094
    default_abort_script_time = 60 * 5 - 20
 
1095
 
 
1096
 
1076
1097
class HourlyDatabaseGarbageCollector(BaseDatabaseGarbageCollector):
 
1098
    """Run every hour.
 
1099
 
 
1100
    Jobs we want to run fairly often but have noticable overhead go here.
 
1101
    """
1077
1102
    script_name = 'garbo-hourly'
1078
1103
    tunable_loops = [
1079
1104
        MirrorBugMessageOwner,
1080
 
        OAuthNoncePruner,
1081
 
        OpenIDConsumerNoncePruner,
1082
 
        OpenIDConsumerAssociationPruner,
1083
1105
        RevisionCachePruner,
1084
1106
        BugWatchScheduler,
1085
1107
        AntiqueSessionPruner,
1095
1117
 
1096
1118
 
1097
1119
class DailyDatabaseGarbageCollector(BaseDatabaseGarbageCollector):
 
1120
    """Run every day.
 
1121
 
 
1122
    Jobs that don't need to be run frequently.
 
1123
 
 
1124
    If there is low overhead, consider putting these tasks in more
 
1125
    frequently invoked lists to distribute the work more evenly.
 
1126
    """
1098
1127
    script_name = 'garbo-daily'
1099
1128
    tunable_loops = [
1100
1129
        BranchJobPruner,