@@ -110,7 +110,6 @@ fn check_stalled_update_downloads(conn: &PgConnection) -> Result<()> {
110110fn check_spam_attack ( conn : & PgConnection ) -> Result < ( ) > {
111111 use cargo_registry:: models:: krate:: canon_crate_name;
112112 use diesel:: dsl:: * ;
113- use diesel:: sql_types:: Bool ;
114113
115114 const EVENT_KEY : & str = "spam_attack" ;
116115
@@ -121,11 +120,6 @@ fn check_spam_attack(conn: &PgConnection) -> Result<()> {
121120 . as_ref ( )
122121 . map ( |s| s. split ( ',' ) . collect ( ) )
123122 . unwrap_or_default ( ) ;
124- let bad_author_patterns = dotenv:: var ( "SPAM_AUTHOR_PATTERNS" ) ;
125- let bad_author_patterns: Vec < _ > = bad_author_patterns
126- . as_ref ( )
127- . map ( |s| s. split ( ',' ) . collect ( ) )
128- . unwrap_or_default ( ) ;
129123
130124 let mut event_description = None ;
131125
@@ -139,19 +133,6 @@ fn check_spam_attack(conn: &PgConnection) -> Result<()> {
139133 event_description = Some ( format ! ( "Crate named {} published" , bad_crate) ) ;
140134 }
141135
142- let mut query = version_authors:: table
143- . select ( version_authors:: name)
144- . filter ( false . into_sql :: < Bool > ( ) ) // Never return anything if we have no patterns
145- . into_boxed ( ) ;
146- for author_pattern in bad_author_patterns {
147- query = query. or_filter ( version_authors:: name. like ( author_pattern) ) ;
148- }
149- let bad_author: Option < String > = query. first ( conn) . optional ( ) ?;
150-
151- if let Some ( bad_author) = bad_author {
152- event_description = Some ( format ! ( "Crate with author {} published" , bad_author) ) ;
153- }
154-
155136 let event = if let Some ( event_description) = event_description {
156137 on_call:: Event :: Trigger {
157138 incident_key : Some ( EVENT_KEY . into ( ) ) ,
0 commit comments