]> source.dussan.org Git - gitea.git/commitdiff
Enable compression for Actions logs by default (#32013)
authorJason Song <i@wolfogre.com>
Mon, 9 Sep 2024 21:34:42 +0000 (05:34 +0800)
committerGitHub <noreply@github.com>
Mon, 9 Sep 2024 21:34:42 +0000 (21:34 +0000)
Close #31801. Follow #31761.

Since there are so many benefits of compression and there are no reports
of related issues after weeks, it should be fine to enable compression
by default.

custom/conf/app.example.ini
modules/setting/actions.go

index 7009df54db473654323a3667103fee5c1ff089c4..a2dd92b1051abccbd4c4807b752330e7a3d33478 100644 (file)
@@ -2695,7 +2695,7 @@ LEVEL = Info
 ;; It's always recommended to use compression when using local disk as log storage if CPU or memory is not a bottleneck.
 ;; And for object storage services like S3, which is billed for requests, it would cause extra 2 times of get requests for each log view.
 ;; But it will save storage space and network bandwidth, so it's still recommended to use compression.
-;LOG_COMPRESSION = none
+;LOG_COMPRESSION = zstd
 ;; Default artifact retention time in days. Artifacts could have their own retention periods by setting the `retention-days` option in `actions/upload-artifact` step.
 ;ARTIFACT_RETENTION_DAYS = 90
 ;; Timeout to stop the task which have running status, but haven't been updated for a long time
index a515b1ca69fdc58ef71d64495ca230b3dc0fdc53..913872eaf23129a966221e756f63c69bb59cdad0 100644 (file)
@@ -62,11 +62,11 @@ func (c logCompression) IsValid() bool {
 }
 
 func (c logCompression) IsNone() bool {
-       return c == "" || strings.ToLower(string(c)) == "none"
+       return strings.ToLower(string(c)) == "none"
 }
 
 func (c logCompression) IsZstd() bool {
-       return strings.ToLower(string(c)) == "zstd"
+       return c == "" || strings.ToLower(string(c)) == "zstd"
 }
 
 func loadActionsFrom(rootCfg ConfigProvider) error {