@@ -720,7 +720,6 @@ def update_app_instances(
720
720
search = False ,
721
721
pdf = False ,
722
722
epub = False ,
723
- delete = True ,
724
723
):
725
724
"""
726
725
Update application instances with build artifacts.
@@ -758,7 +757,6 @@ def update_app_instances(
758
757
localmedia = False
759
758
pdf = False
760
759
epub = False
761
- delete = False
762
760
763
761
# Broadcast finalization steps to web application instances
764
762
broadcast (
@@ -776,7 +774,6 @@ def update_app_instances(
776
774
search = search ,
777
775
pdf = pdf ,
778
776
epub = epub ,
779
- delete = delete ,
780
777
),
781
778
callback = sync_callback .s (
782
779
version_pk = self .version .pk ,
@@ -933,7 +930,6 @@ def sync_files(
933
930
search = False ,
934
931
pdf = False ,
935
932
epub = False ,
936
- delete = False ,
937
933
):
938
934
"""
939
935
Sync build artifacts to application instances.
@@ -945,41 +941,40 @@ def sync_files(
945
941
version = Version .objects .get_object_or_log (pk = version_pk )
946
942
if not version :
947
943
return
948
- if delete :
949
- if not pdf :
950
- remove_dirs ([
951
- version .project .get_production_media_path (
952
- type_ = 'pdf' ,
953
- version_slug = version .slug ,
954
- ),
955
- ])
944
+ if not pdf :
945
+ remove_dirs ([
946
+ version .project .get_production_media_path (
947
+ type_ = 'pdf' ,
948
+ version_slug = version .slug ,
949
+ ),
950
+ ])
956
951
957
- if getattr (storage , 'write_build_media' , False ):
958
- # Remove PDF from remote storage if it exists
959
- storage_path = version .project .get_storage_path (
960
- type_ = 'pdf' ,
961
- version_slug = version .slug ,
962
- )
963
- if storage .exists (storage_path ):
964
- log .info ('Removing %s from media storage' , storage_path )
965
- storage .delete (storage_path )
966
- if not epub :
967
- remove_dirs ([
968
- version .project .get_production_media_path (
969
- type_ = 'epub' ,
970
- version_slug = version .slug ,
971
- ),
972
- ])
952
+ if getattr (storage , 'write_build_media' , False ):
953
+ # Remove PDF from remote storage if it exists
954
+ storage_path = version .project .get_storage_path (
955
+ type_ = 'pdf' ,
956
+ version_slug = version .slug ,
957
+ )
958
+ if storage .exists (storage_path ):
959
+ log .info ('Removing %s from media storage' , storage_path )
960
+ storage .delete (storage_path )
961
+ if not epub :
962
+ remove_dirs ([
963
+ version .project .get_production_media_path (
964
+ type_ = 'epub' ,
965
+ version_slug = version .slug ,
966
+ ),
967
+ ])
973
968
974
- if getattr (storage , 'write_build_media' , False ):
975
- # Remove ePub from remote storage if it exists
976
- storage_path = version .project .get_storage_path (
977
- type_ = 'epub' ,
978
- version_slug = version .slug ,
979
- )
980
- if storage .exists (storage_path ):
981
- log .info ('Removing %s from media storage' , storage_path )
982
- storage .delete (storage_path )
969
+ if getattr (storage , 'write_build_media' , False ):
970
+ # Remove ePub from remote storage if it exists
971
+ storage_path = version .project .get_storage_path (
972
+ type_ = 'epub' ,
973
+ version_slug = version .slug ,
974
+ )
975
+ if storage .exists (storage_path ):
976
+ log .info ('Removing %s from media storage' , storage_path )
977
+ storage .delete (storage_path )
983
978
984
979
# Sync files to the web servers
985
980
move_files (
0 commit comments