Version: Unity 6.6 Alpha (6000.6)
LanguageEnglish
  • C#

BuildHistory.ApplyRetentionPolicy

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static int ApplyRetentionPolicy();

Returns

int The number of build metadata directories successfully deleted.

Description

Deletes the oldest builds in the build history so that no more than BuildHistory.BuildHistoryLimit remain.

If BuildHistory.BuildHistoryLimit is 0, or the current build count is at or below the limit, no entries are removed and this method returns 0.

If a folder cannot be deleted (for example, due to a file lock or a permissions issue), a warning is logged and the operation continues with the remaining entries.

Additional resources: BuildHistory.BuildHistoryLimit