1 /*
2  *  Make.org Core API
3  *  Copyright (C) 2018 Make.org
4  *
5  * This program is free software: you can redistribute it and/or modify
6  *  it under the terms of the GNU Affero General Public License as
7  *  published by the Free Software Foundation, either version 3 of the
8  *  License, or (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU Affero General Public License for more details.
14  *
15  *  You should have received a copy of the GNU Affero General Public License
16  *  along with this program.  If not, see <https://www.gnu.org/licenses/>.
17  *
18  */
19 
20 package org.make.api.technical
21 
22 import akka.http.scaladsl.model.StatusCodes
23 import akka.http.scaladsl.server.{Directives, Route}
24 import grizzled.slf4j.Logging
25 import io.swagger.annotations._
26 import org.make.api.operation.OperationServiceComponent
27 import org.make.api.question.QuestionServiceComponent
28 import org.make.api.technical.MakeDirectives.MakeDirectivesDependencies
29 import org.make.api.user.UserServiceComponent
30 import org.make.api.userhistory.UserHistoryCoordinatorServiceComponent
31 import org.make.core._
32 import org.make.core.technical.Pagination
33 
34 import javax.ws.rs.Path
35 import scala.concurrent.ExecutionContext.Implicits.global
36 import scala.concurrent.Future
37 import scala.util.{Failure, Success}
38 
39 @Api(value = "Migrations")
40 @Path(value = "/migrations")
41 trait MigrationApi extends Directives {
42 
43   def emptyRoute: Route
44 
45   @ApiOperation(
46     value = "modify-avatars-swift-path",
47     httpMethod = "POST",
48     code = HttpCodes.NoContent,
49     authorizations = Array(
50       new Authorization(
51         value = "MakeApi",
52         scopes = Array(new AuthorizationScope(scope = "admin", description = "BO Admin"))
53       )
54     )
55   )
56   @ApiImplicitParams(
57     value = Array(new ApiImplicitParam(name = "dry", paramType = "query", dataType = "boolean", required = true))
58   )
59   @ApiResponses(value = Array(new ApiResponse(code = HttpCodes.NoContent, message = "No Content")))
60   @Path(value = "/modify-avatars-swift-path")
61   def modifyAvatarsSwiftPath: Route
62 
63   def routes: Route = modifyAvatarsSwiftPath
64 }
65 
66 trait MigrationApiComponent {
67   def migrationApi: MigrationApi
68 }
69 
70 trait DefaultMigrationApiComponent extends MigrationApiComponent with MakeAuthenticationDirectives with Logging {
71   this: MakeDirectivesDependencies
72     with ActorSystemComponent
73     with ReadJournalComponent
74     with UserServiceComponent
75     with UserHistoryCoordinatorServiceComponent
76     with QuestionServiceComponent
77     with OperationServiceComponent =>
78 
79   override lazy val migrationApi: MigrationApi = new DefaultMigrationApi
80 
81   class DefaultMigrationApi extends MigrationApi {
82     override def emptyRoute: Route =
83       get {
84         path("migrations") {
85           complete(StatusCodes.OK)
86         }
87       }
88 
89     override def modifyAvatarsSwiftPath: Route = post {
90       path("migrations" / "modify-avatars-swift-path") {
91         makeOperation("ModifyAvatarsSwiftPath") { _ =>
92           makeOAuth2 { userAuth =>
93             requireAdminRole(userAuth.user) {
94               parameter("dry".as[Boolean]) { dry =>
95                 val batchSize: Int = 1000
96                 val startTime = System.currentTimeMillis()
97                 val eventDate = DateHelper.now()
98                 StreamUtils
99                   .asyncPageToPageSource(
100                     offset =>
101                       userService.adminFindUsers(
102                         Pagination.Offset(offset),
103                         Some(Pagination.End(offset + batchSize)),
104                         None,
105                         None,
106                         None,
107                         None,
108                         None,
109                         None,
110                         None,
111                         None
112                       )
113                   )
114                   .map { users =>
115                     users.map(user => user.userId -> user.profile.flatMap(_.avatarUrl))
116                   }
117                   .mapConcat(identity)
118                   .collect { case (id, Some(avatarUrl)) => id -> avatarUrl }
119                   .mapAsync(5) {
120                     case (id, avatarUrl) =>
121                       if (dry) {
122                         Future.successful(1)
123                       } else {
124                         userService
125                           .changeAvatarForUser(id, avatarUrl, RequestContext.empty, eventDate)
126                           .map(_ => 1)
127                       }
128                   }
129                   .runFold(0)(_ + _)
130                   .onComplete {
131                     case Success(count) =>
132                       val time = System.currentTimeMillis() - startTime
133                       logger.info(s"$count users have had their avatars updated in $time ms")
134                     case Failure(exception) =>
135                       logger.error("Error while updating avatars path:", exception)
136                   }
137 
138                 complete(StatusCodes.NoContent)
139               }
140             }
141           }
142         }
143       }
144     }
145 
146   }
147 }
Line Stmt Id Pos Tree Symbol Tests Code
63 49617 2222 - 2244 Select org.make.api.technical.MigrationApi.modifyAvatarsSwiftPath MigrationApi.this.modifyAvatarsSwiftPath
83 41347 2842 - 2845 Select akka.http.scaladsl.server.directives.MethodDirectives.get DefaultMigrationApi.this.get
83 49656 2842 - 2929 Apply scala.Function1.apply server.this.Directive.addByNameNullaryApply(DefaultMigrationApi.this.get).apply(server.this.Directive.addByNameNullaryApply(DefaultMigrationApi.this.path[Unit](DefaultMigrationApi.this._segmentStringToPathMatcher("migrations"))).apply(DefaultMigrationApi.this.complete(marshalling.this.ToResponseMarshallable.apply[akka.http.scaladsl.model.StatusCodes.Success](akka.http.scaladsl.model.StatusCodes.OK)(marshalling.this.Marshaller.fromStatusCode))))
84 34248 2861 - 2873 ApplyImplicitView akka.http.scaladsl.server.ImplicitPathMatcherConstruction._segmentStringToPathMatcher DefaultMigrationApi.this._segmentStringToPathMatcher("migrations")
84 32625 2856 - 2921 Apply scala.Function1.apply server.this.Directive.addByNameNullaryApply(DefaultMigrationApi.this.path[Unit](DefaultMigrationApi.this._segmentStringToPathMatcher("migrations"))).apply(DefaultMigrationApi.this.complete(marshalling.this.ToResponseMarshallable.apply[akka.http.scaladsl.model.StatusCodes.Success](akka.http.scaladsl.model.StatusCodes.OK)(marshalling.this.Marshaller.fromStatusCode)))
84 46232 2856 - 2874 Apply akka.http.scaladsl.server.directives.PathDirectives.path DefaultMigrationApi.this.path[Unit](DefaultMigrationApi.this._segmentStringToPathMatcher("migrations"))
85 43133 2896 - 2910 Select akka.http.scaladsl.model.StatusCodes.OK akka.http.scaladsl.model.StatusCodes.OK
85 39747 2887 - 2911 Apply akka.http.scaladsl.server.directives.RouteDirectives.complete DefaultMigrationApi.this.complete(marshalling.this.ToResponseMarshallable.apply[akka.http.scaladsl.model.StatusCodes.Success](akka.http.scaladsl.model.StatusCodes.OK)(marshalling.this.Marshaller.fromStatusCode))
85 48635 2896 - 2910 ApplyToImplicitArgs akka.http.scaladsl.marshalling.ToResponseMarshallable.apply marshalling.this.ToResponseMarshallable.apply[akka.http.scaladsl.model.StatusCodes.Success](akka.http.scaladsl.model.StatusCodes.OK)(marshalling.this.Marshaller.fromStatusCode)
85 35267 2908 - 2908 Select akka.http.scaladsl.marshalling.PredefinedToResponseMarshallers.fromStatusCode marshalling.this.Marshaller.fromStatusCode
89 42178 2980 - 5133 Apply scala.Function1.apply server.this.Directive.addByNameNullaryApply(DefaultMigrationApi.this.post).apply(server.this.Directive.addByNameNullaryApply(DefaultMigrationApi.this.path[Unit](DefaultMigrationApi.this._segmentStringToPathMatcher("migrations")./[Unit](DefaultMigrationApi.this._segmentStringToPathMatcher("modify-avatars-swift-path"))(TupleOps.this.Join.join0P[Unit]))).apply(server.this.Directive.addDirectiveApply[(org.make.core.RequestContext,)](DefaultMigrationApiComponent.this.makeOperation("ModifyAvatarsSwiftPath", DefaultMigrationApiComponent.this.makeOperation$default$2, DefaultMigrationApiComponent.this.makeOperation$default$3))(util.this.ApplyConverter.hac1[org.make.core.RequestContext]).apply(((x$1: org.make.core.RequestContext) => server.this.Directive.addDirectiveApply[(scalaoauth2.provider.AuthInfo[org.make.core.auth.UserRights],)](DefaultMigrationApiComponent.this.makeOAuth2)(util.this.ApplyConverter.hac1[scalaoauth2.provider.AuthInfo[org.make.core.auth.UserRights]]).apply(((userAuth: scalaoauth2.provider.AuthInfo[org.make.core.auth.UserRights]) => server.this.Directive.addByNameNullaryApply(DefaultMigrationApiComponent.this.requireAdminRole(userAuth.user)).apply(server.this.Directive.addDirectiveApply[(Boolean,)](DefaultMigrationApi.this.parameter(ParameterDirectives.this.ParamSpec.forNR[Boolean](DefaultMigrationApi.this._string2NR("dry").as[Boolean])(unmarshalling.this.Unmarshaller.booleanFromStringUnmarshaller)))(util.this.ApplyConverter.hac1[Boolean]).apply(((dry: Boolean) => { val batchSize: Int = 1000; val startTime: Long = java.lang.System.currentTimeMillis(); val eventDate: java.time.ZonedDateTime = org.make.core.DateHelper.now(); StreamUtils.asyncPageToPageSource[org.make.core.user.User](((offset: Int) => DefaultMigrationApiComponent.this.userService.adminFindUsers(org.make.core.technical.Pagination.Offset.apply(offset), scala.Some.apply[org.make.core.technical.Pagination.End](org.make.core.technical.Pagination.End.apply(offset.+(batchSize))), scala.None, scala.None, scala.None, scala.None, scala.None, scala.None, scala.None, scala.None)))(scala.concurrent.ExecutionContext.Implicits.global).map[Seq[(org.make.core.user.UserId, Option[String])]](((users: Seq[org.make.core.user.User]) => users.map[(org.make.core.user.UserId, Option[String])](((user: org.make.core.user.User) => scala.Predef.ArrowAssoc[org.make.core.user.UserId](user.userId).->[Option[String]](user.profile.flatMap[String](((x$2: org.make.core.profile.Profile) => x$2.avatarUrl))))))).mapConcat[(org.make.core.user.UserId, Option[String])](((x: Seq[(org.make.core.user.UserId, Option[String])]) => scala.Predef.identity[Seq[(org.make.core.user.UserId, Option[String])]](x))).collect[(org.make.core.user.UserId, String)](({ @SerialVersionUID(value = 0) final <synthetic> class $anonfun extends scala.runtime.AbstractPartialFunction[(org.make.core.user.UserId, Option[String]),(org.make.core.user.UserId, String)] with java.io.Serializable { def <init>(): <$anon: ((org.make.core.user.UserId, Option[String])) => (org.make.core.user.UserId, String)> = { $anonfun.super.<init>(); () }; final override def applyOrElse[A1 <: (org.make.core.user.UserId, Option[String]), B1 >: (org.make.core.user.UserId, String)](x1: A1, default: A1 => B1): B1 = ((x1.asInstanceOf[(org.make.core.user.UserId, Option[String])]: (org.make.core.user.UserId, Option[String])): (org.make.core.user.UserId, Option[String]) @unchecked) match { case (_1: org.make.core.user.UserId, _2: Option[String]): (org.make.core.user.UserId, Option[String])((id @ _), (value: String): Some[String]((avatarUrl @ _))) => scala.Predef.ArrowAssoc[org.make.core.user.UserId](id).->[String](avatarUrl) case (defaultCase$ @ _) => default.apply(x1) }; final def isDefinedAt(x1: (org.make.core.user.UserId, Option[String])): Boolean = ((x1.asInstanceOf[(org.make.core.user.UserId, Option[String])]: (org.make.core.user.UserId, Option[String])): (org.make.core.user.UserId, Option[String]) @unchecked) match { case (_1: org.make.core.user.UserId, _2: Option[String]): (org.make.core.user.UserId, Option[String])((id @ _), (value: String): Some[String]((avatarUrl @ _))) => true case (defaultCase$ @ _) => false } }; new $anonfun() }: PartialFunction[(org.make.core.user.UserId, Option[String]),(org.make.core.user.UserId, String)])).mapAsync[Int](5)(((x0$1: (org.make.core.user.UserId, String)) => x0$1 match { case (_1: org.make.core.user.UserId, _2: String): (org.make.core.user.UserId, String)((id @ _), (avatarUrl @ _)) => if (dry) scala.concurrent.Future.successful[Int](1) else DefaultMigrationApiComponent.this.userService.changeAvatarForUser(id, avatarUrl, org.make.core.RequestContext.empty, eventDate).map[Int](((x$3: Unit) => 1))(scala.concurrent.ExecutionContext.Implicits.global) })).runFold[Int](0)(((x$4: Int, x$5: Int) => x$4.+(x$5)))(stream.this.Materializer.matFromSystem(DefaultMigrationApiComponent.this.actorSystem)).onComplete[Unit](((x0$2: scala.util.Try[Int]) => x0$2 match { case (value: Int): scala.util.Success[Int]((count @ _)) => { val time: Long = java.lang.System.currentTimeMillis().-(startTime); DefaultMigrationApiComponent.this.logger.info(("".+(count).+(" users have had their avatars updated in ").+(time).+(" ms"): String)) } case (exception: Throwable): scala.util.Failure[Int]((exception @ _)) => DefaultMigrationApiComponent.this.logger.error("Error while updating avatars path:", exception) }))(scala.concurrent.ExecutionContext.Implicits.global); DefaultMigrationApi.this.complete(marshalling.this.ToResponseMarshallable.apply[akka.http.scaladsl.model.StatusCodes.Success](akka.http.scaladsl.model.StatusCodes.NoContent)(marshalling.this.Marshaller.fromStatusCode)) })))))))))
89 41261 2980 - 2984 Select akka.http.scaladsl.server.directives.MethodDirectives.post DefaultMigrationApi.this.post
90 45277 2993 - 5127 Apply scala.Function1.apply server.this.Directive.addByNameNullaryApply(DefaultMigrationApi.this.path[Unit](DefaultMigrationApi.this._segmentStringToPathMatcher("migrations")./[Unit](DefaultMigrationApi.this._segmentStringToPathMatcher("modify-avatars-swift-path"))(TupleOps.this.Join.join0P[Unit]))).apply(server.this.Directive.addDirectiveApply[(org.make.core.RequestContext,)](DefaultMigrationApiComponent.this.makeOperation("ModifyAvatarsSwiftPath", DefaultMigrationApiComponent.this.makeOperation$default$2, DefaultMigrationApiComponent.this.makeOperation$default$3))(util.this.ApplyConverter.hac1[org.make.core.RequestContext]).apply(((x$1: org.make.core.RequestContext) => server.this.Directive.addDirectiveApply[(scalaoauth2.provider.AuthInfo[org.make.core.auth.UserRights],)](DefaultMigrationApiComponent.this.makeOAuth2)(util.this.ApplyConverter.hac1[scalaoauth2.provider.AuthInfo[org.make.core.auth.UserRights]]).apply(((userAuth: scalaoauth2.provider.AuthInfo[org.make.core.auth.UserRights]) => server.this.Directive.addByNameNullaryApply(DefaultMigrationApiComponent.this.requireAdminRole(userAuth.user)).apply(server.this.Directive.addDirectiveApply[(Boolean,)](DefaultMigrationApi.this.parameter(ParameterDirectives.this.ParamSpec.forNR[Boolean](DefaultMigrationApi.this._string2NR("dry").as[Boolean])(unmarshalling.this.Unmarshaller.booleanFromStringUnmarshaller)))(util.this.ApplyConverter.hac1[Boolean]).apply(((dry: Boolean) => { val batchSize: Int = 1000; val startTime: Long = java.lang.System.currentTimeMillis(); val eventDate: java.time.ZonedDateTime = org.make.core.DateHelper.now(); StreamUtils.asyncPageToPageSource[org.make.core.user.User](((offset: Int) => DefaultMigrationApiComponent.this.userService.adminFindUsers(org.make.core.technical.Pagination.Offset.apply(offset), scala.Some.apply[org.make.core.technical.Pagination.End](org.make.core.technical.Pagination.End.apply(offset.+(batchSize))), scala.None, scala.None, scala.None, scala.None, scala.None, scala.None, scala.None, scala.None)))(scala.concurrent.ExecutionContext.Implicits.global).map[Seq[(org.make.core.user.UserId, Option[String])]](((users: Seq[org.make.core.user.User]) => users.map[(org.make.core.user.UserId, Option[String])](((user: org.make.core.user.User) => scala.Predef.ArrowAssoc[org.make.core.user.UserId](user.userId).->[Option[String]](user.profile.flatMap[String](((x$2: org.make.core.profile.Profile) => x$2.avatarUrl))))))).mapConcat[(org.make.core.user.UserId, Option[String])](((x: Seq[(org.make.core.user.UserId, Option[String])]) => scala.Predef.identity[Seq[(org.make.core.user.UserId, Option[String])]](x))).collect[(org.make.core.user.UserId, String)](({ @SerialVersionUID(value = 0) final <synthetic> class $anonfun extends scala.runtime.AbstractPartialFunction[(org.make.core.user.UserId, Option[String]),(org.make.core.user.UserId, String)] with java.io.Serializable { def <init>(): <$anon: ((org.make.core.user.UserId, Option[String])) => (org.make.core.user.UserId, String)> = { $anonfun.super.<init>(); () }; final override def applyOrElse[A1 <: (org.make.core.user.UserId, Option[String]), B1 >: (org.make.core.user.UserId, String)](x1: A1, default: A1 => B1): B1 = ((x1.asInstanceOf[(org.make.core.user.UserId, Option[String])]: (org.make.core.user.UserId, Option[String])): (org.make.core.user.UserId, Option[String]) @unchecked) match { case (_1: org.make.core.user.UserId, _2: Option[String]): (org.make.core.user.UserId, Option[String])((id @ _), (value: String): Some[String]((avatarUrl @ _))) => scala.Predef.ArrowAssoc[org.make.core.user.UserId](id).->[String](avatarUrl) case (defaultCase$ @ _) => default.apply(x1) }; final def isDefinedAt(x1: (org.make.core.user.UserId, Option[String])): Boolean = ((x1.asInstanceOf[(org.make.core.user.UserId, Option[String])]: (org.make.core.user.UserId, Option[String])): (org.make.core.user.UserId, Option[String]) @unchecked) match { case (_1: org.make.core.user.UserId, _2: Option[String]): (org.make.core.user.UserId, Option[String])((id @ _), (value: String): Some[String]((avatarUrl @ _))) => true case (defaultCase$ @ _) => false } }; new $anonfun() }: PartialFunction[(org.make.core.user.UserId, Option[String]),(org.make.core.user.UserId, String)])).mapAsync[Int](5)(((x0$1: (org.make.core.user.UserId, String)) => x0$1 match { case (_1: org.make.core.user.UserId, _2: String): (org.make.core.user.UserId, String)((id @ _), (avatarUrl @ _)) => if (dry) scala.concurrent.Future.successful[Int](1) else DefaultMigrationApiComponent.this.userService.changeAvatarForUser(id, avatarUrl, org.make.core.RequestContext.empty, eventDate).map[Int](((x$3: Unit) => 1))(scala.concurrent.ExecutionContext.Implicits.global) })).runFold[Int](0)(((x$4: Int, x$5: Int) => x$4.+(x$5)))(stream.this.Materializer.matFromSystem(DefaultMigrationApiComponent.this.actorSystem)).onComplete[Unit](((x0$2: scala.util.Try[Int]) => x0$2 match { case (value: Int): scala.util.Success[Int]((count @ _)) => { val time: Long = java.lang.System.currentTimeMillis().-(startTime); DefaultMigrationApiComponent.this.logger.info(("".+(count).+(" users have had their avatars updated in ").+(time).+(" ms"): String)) } case (exception: Throwable): scala.util.Failure[Int]((exception @ _)) => DefaultMigrationApiComponent.this.logger.error("Error while updating avatars path:", exception) }))(scala.concurrent.ExecutionContext.Implicits.global); DefaultMigrationApi.this.complete(marshalling.this.ToResponseMarshallable.apply[akka.http.scaladsl.model.StatusCodes.Success](akka.http.scaladsl.model.StatusCodes.NoContent)(marshalling.this.Marshaller.fromStatusCode)) }))))))))
90 47792 2993 - 3041 Apply akka.http.scaladsl.server.directives.PathDirectives.path DefaultMigrationApi.this.path[Unit](DefaultMigrationApi.this._segmentStringToPathMatcher("migrations")./[Unit](DefaultMigrationApi.this._segmentStringToPathMatcher("modify-avatars-swift-path"))(TupleOps.this.Join.join0P[Unit]))
90 42884 3011 - 3011 TypeApply akka.http.scaladsl.server.util.TupleOps.Join.join0P TupleOps.this.Join.join0P[Unit]
90 34283 2998 - 3010 Literal <nosymbol> "migrations"
90 46268 3013 - 3040 ApplyImplicitView akka.http.scaladsl.server.ImplicitPathMatcherConstruction._segmentStringToPathMatcher DefaultMigrationApi.this._segmentStringToPathMatcher("modify-avatars-swift-path")
90 35307 2998 - 3040 ApplyToImplicitArgs akka.http.scaladsl.server.PathMatcher./ DefaultMigrationApi.this._segmentStringToPathMatcher("migrations")./[Unit](DefaultMigrationApi.this._segmentStringToPathMatcher("modify-avatars-swift-path"))(TupleOps.this.Join.join0P[Unit])
91 32660 3052 - 3052 Select org.make.api.technical.MakeDirectives.makeOperation$default$2 DefaultMigrationApiComponent.this.makeOperation$default$2
91 32950 3052 - 5119 Apply scala.Function1.apply server.this.Directive.addDirectiveApply[(org.make.core.RequestContext,)](DefaultMigrationApiComponent.this.makeOperation("ModifyAvatarsSwiftPath", DefaultMigrationApiComponent.this.makeOperation$default$2, DefaultMigrationApiComponent.this.makeOperation$default$3))(util.this.ApplyConverter.hac1[org.make.core.RequestContext]).apply(((x$1: org.make.core.RequestContext) => server.this.Directive.addDirectiveApply[(scalaoauth2.provider.AuthInfo[org.make.core.auth.UserRights],)](DefaultMigrationApiComponent.this.makeOAuth2)(util.this.ApplyConverter.hac1[scalaoauth2.provider.AuthInfo[org.make.core.auth.UserRights]]).apply(((userAuth: scalaoauth2.provider.AuthInfo[org.make.core.auth.UserRights]) => server.this.Directive.addByNameNullaryApply(DefaultMigrationApiComponent.this.requireAdminRole(userAuth.user)).apply(server.this.Directive.addDirectiveApply[(Boolean,)](DefaultMigrationApi.this.parameter(ParameterDirectives.this.ParamSpec.forNR[Boolean](DefaultMigrationApi.this._string2NR("dry").as[Boolean])(unmarshalling.this.Unmarshaller.booleanFromStringUnmarshaller)))(util.this.ApplyConverter.hac1[Boolean]).apply(((dry: Boolean) => { val batchSize: Int = 1000; val startTime: Long = java.lang.System.currentTimeMillis(); val eventDate: java.time.ZonedDateTime = org.make.core.DateHelper.now(); StreamUtils.asyncPageToPageSource[org.make.core.user.User](((offset: Int) => DefaultMigrationApiComponent.this.userService.adminFindUsers(org.make.core.technical.Pagination.Offset.apply(offset), scala.Some.apply[org.make.core.technical.Pagination.End](org.make.core.technical.Pagination.End.apply(offset.+(batchSize))), scala.None, scala.None, scala.None, scala.None, scala.None, scala.None, scala.None, scala.None)))(scala.concurrent.ExecutionContext.Implicits.global).map[Seq[(org.make.core.user.UserId, Option[String])]](((users: Seq[org.make.core.user.User]) => users.map[(org.make.core.user.UserId, Option[String])](((user: org.make.core.user.User) => scala.Predef.ArrowAssoc[org.make.core.user.UserId](user.userId).->[Option[String]](user.profile.flatMap[String](((x$2: org.make.core.profile.Profile) => x$2.avatarUrl))))))).mapConcat[(org.make.core.user.UserId, Option[String])](((x: Seq[(org.make.core.user.UserId, Option[String])]) => scala.Predef.identity[Seq[(org.make.core.user.UserId, Option[String])]](x))).collect[(org.make.core.user.UserId, String)](({ @SerialVersionUID(value = 0) final <synthetic> class $anonfun extends scala.runtime.AbstractPartialFunction[(org.make.core.user.UserId, Option[String]),(org.make.core.user.UserId, String)] with java.io.Serializable { def <init>(): <$anon: ((org.make.core.user.UserId, Option[String])) => (org.make.core.user.UserId, String)> = { $anonfun.super.<init>(); () }; final override def applyOrElse[A1 <: (org.make.core.user.UserId, Option[String]), B1 >: (org.make.core.user.UserId, String)](x1: A1, default: A1 => B1): B1 = ((x1.asInstanceOf[(org.make.core.user.UserId, Option[String])]: (org.make.core.user.UserId, Option[String])): (org.make.core.user.UserId, Option[String]) @unchecked) match { case (_1: org.make.core.user.UserId, _2: Option[String]): (org.make.core.user.UserId, Option[String])((id @ _), (value: String): Some[String]((avatarUrl @ _))) => scala.Predef.ArrowAssoc[org.make.core.user.UserId](id).->[String](avatarUrl) case (defaultCase$ @ _) => default.apply(x1) }; final def isDefinedAt(x1: (org.make.core.user.UserId, Option[String])): Boolean = ((x1.asInstanceOf[(org.make.core.user.UserId, Option[String])]: (org.make.core.user.UserId, Option[String])): (org.make.core.user.UserId, Option[String]) @unchecked) match { case (_1: org.make.core.user.UserId, _2: Option[String]): (org.make.core.user.UserId, Option[String])((id @ _), (value: String): Some[String]((avatarUrl @ _))) => true case (defaultCase$ @ _) => false } }; new $anonfun() }: PartialFunction[(org.make.core.user.UserId, Option[String]),(org.make.core.user.UserId, String)])).mapAsync[Int](5)(((x0$1: (org.make.core.user.UserId, String)) => x0$1 match { case (_1: org.make.core.user.UserId, _2: String): (org.make.core.user.UserId, String)((id @ _), (avatarUrl @ _)) => if (dry) scala.concurrent.Future.successful[Int](1) else DefaultMigrationApiComponent.this.userService.changeAvatarForUser(id, avatarUrl, org.make.core.RequestContext.empty, eventDate).map[Int](((x$3: Unit) => 1))(scala.concurrent.ExecutionContext.Implicits.global) })).runFold[Int](0)(((x$4: Int, x$5: Int) => x$4.+(x$5)))(stream.this.Materializer.matFromSystem(DefaultMigrationApiComponent.this.actorSystem)).onComplete[Unit](((x0$2: scala.util.Try[Int]) => x0$2 match { case (value: Int): scala.util.Success[Int]((count @ _)) => { val time: Long = java.lang.System.currentTimeMillis().-(startTime); DefaultMigrationApiComponent.this.logger.info(("".+(count).+(" users have had their avatars updated in ").+(time).+(" ms"): String)) } case (exception: Throwable): scala.util.Failure[Int]((exception @ _)) => DefaultMigrationApiComponent.this.logger.error("Error while updating avatars path:", exception) }))(scala.concurrent.ExecutionContext.Implicits.global); DefaultMigrationApi.this.complete(marshalling.this.ToResponseMarshallable.apply[akka.http.scaladsl.model.StatusCodes.Success](akka.http.scaladsl.model.StatusCodes.NoContent)(marshalling.this.Marshaller.fromStatusCode)) })))))))
91 40814 3066 - 3090 Literal <nosymbol> "ModifyAvatarsSwiftPath"
91 33719 3065 - 3065 TypeApply akka.http.scaladsl.server.util.ApplyConverterInstances.hac1 util.this.ApplyConverter.hac1[org.make.core.RequestContext]
91 49411 3052 - 3052 Select org.make.api.technical.MakeDirectives.makeOperation$default$3 DefaultMigrationApiComponent.this.makeOperation$default$3
91 41297 3052 - 3091 Apply org.make.api.technical.MakeDirectives.makeOperation DefaultMigrationApiComponent.this.makeOperation("ModifyAvatarsSwiftPath", DefaultMigrationApiComponent.this.makeOperation$default$2, DefaultMigrationApiComponent.this.makeOperation$default$3)
92 42926 3109 - 3109 TypeApply akka.http.scaladsl.server.util.ApplyConverterInstances.hac1 util.this.ApplyConverter.hac1[scalaoauth2.provider.AuthInfo[org.make.core.auth.UserRights]]
92 39781 3109 - 5109 Apply scala.Function1.apply server.this.Directive.addDirectiveApply[(scalaoauth2.provider.AuthInfo[org.make.core.auth.UserRights],)](DefaultMigrationApiComponent.this.makeOAuth2)(util.this.ApplyConverter.hac1[scalaoauth2.provider.AuthInfo[org.make.core.auth.UserRights]]).apply(((userAuth: scalaoauth2.provider.AuthInfo[org.make.core.auth.UserRights]) => server.this.Directive.addByNameNullaryApply(DefaultMigrationApiComponent.this.requireAdminRole(userAuth.user)).apply(server.this.Directive.addDirectiveApply[(Boolean,)](DefaultMigrationApi.this.parameter(ParameterDirectives.this.ParamSpec.forNR[Boolean](DefaultMigrationApi.this._string2NR("dry").as[Boolean])(unmarshalling.this.Unmarshaller.booleanFromStringUnmarshaller)))(util.this.ApplyConverter.hac1[Boolean]).apply(((dry: Boolean) => { val batchSize: Int = 1000; val startTime: Long = java.lang.System.currentTimeMillis(); val eventDate: java.time.ZonedDateTime = org.make.core.DateHelper.now(); StreamUtils.asyncPageToPageSource[org.make.core.user.User](((offset: Int) => DefaultMigrationApiComponent.this.userService.adminFindUsers(org.make.core.technical.Pagination.Offset.apply(offset), scala.Some.apply[org.make.core.technical.Pagination.End](org.make.core.technical.Pagination.End.apply(offset.+(batchSize))), scala.None, scala.None, scala.None, scala.None, scala.None, scala.None, scala.None, scala.None)))(scala.concurrent.ExecutionContext.Implicits.global).map[Seq[(org.make.core.user.UserId, Option[String])]](((users: Seq[org.make.core.user.User]) => users.map[(org.make.core.user.UserId, Option[String])](((user: org.make.core.user.User) => scala.Predef.ArrowAssoc[org.make.core.user.UserId](user.userId).->[Option[String]](user.profile.flatMap[String](((x$2: org.make.core.profile.Profile) => x$2.avatarUrl))))))).mapConcat[(org.make.core.user.UserId, Option[String])](((x: Seq[(org.make.core.user.UserId, Option[String])]) => scala.Predef.identity[Seq[(org.make.core.user.UserId, Option[String])]](x))).collect[(org.make.core.user.UserId, String)](({ @SerialVersionUID(value = 0) final <synthetic> class $anonfun extends scala.runtime.AbstractPartialFunction[(org.make.core.user.UserId, Option[String]),(org.make.core.user.UserId, String)] with java.io.Serializable { def <init>(): <$anon: ((org.make.core.user.UserId, Option[String])) => (org.make.core.user.UserId, String)> = { $anonfun.super.<init>(); () }; final override def applyOrElse[A1 <: (org.make.core.user.UserId, Option[String]), B1 >: (org.make.core.user.UserId, String)](x1: A1, default: A1 => B1): B1 = ((x1.asInstanceOf[(org.make.core.user.UserId, Option[String])]: (org.make.core.user.UserId, Option[String])): (org.make.core.user.UserId, Option[String]) @unchecked) match { case (_1: org.make.core.user.UserId, _2: Option[String]): (org.make.core.user.UserId, Option[String])((id @ _), (value: String): Some[String]((avatarUrl @ _))) => scala.Predef.ArrowAssoc[org.make.core.user.UserId](id).->[String](avatarUrl) case (defaultCase$ @ _) => default.apply(x1) }; final def isDefinedAt(x1: (org.make.core.user.UserId, Option[String])): Boolean = ((x1.asInstanceOf[(org.make.core.user.UserId, Option[String])]: (org.make.core.user.UserId, Option[String])): (org.make.core.user.UserId, Option[String]) @unchecked) match { case (_1: org.make.core.user.UserId, _2: Option[String]): (org.make.core.user.UserId, Option[String])((id @ _), (value: String): Some[String]((avatarUrl @ _))) => true case (defaultCase$ @ _) => false } }; new $anonfun() }: PartialFunction[(org.make.core.user.UserId, Option[String]),(org.make.core.user.UserId, String)])).mapAsync[Int](5)(((x0$1: (org.make.core.user.UserId, String)) => x0$1 match { case (_1: org.make.core.user.UserId, _2: String): (org.make.core.user.UserId, String)((id @ _), (avatarUrl @ _)) => if (dry) scala.concurrent.Future.successful[Int](1) else DefaultMigrationApiComponent.this.userService.changeAvatarForUser(id, avatarUrl, org.make.core.RequestContext.empty, eventDate).map[Int](((x$3: Unit) => 1))(scala.concurrent.ExecutionContext.Implicits.global) })).runFold[Int](0)(((x$4: Int, x$5: Int) => x$4.+(x$5)))(stream.this.Materializer.matFromSystem(DefaultMigrationApiComponent.this.actorSystem)).onComplete[Unit](((x0$2: scala.util.Try[Int]) => x0$2 match { case (value: Int): scala.util.Success[Int]((count @ _)) => { val time: Long = java.lang.System.currentTimeMillis().-(startTime); DefaultMigrationApiComponent.this.logger.info(("".+(count).+(" users have had their avatars updated in ").+(time).+(" ms"): String)) } case (exception: Throwable): scala.util.Failure[Int]((exception @ _)) => DefaultMigrationApiComponent.this.logger.error("Error while updating avatars path:", exception) }))(scala.concurrent.ExecutionContext.Implicits.global); DefaultMigrationApi.this.complete(marshalling.this.ToResponseMarshallable.apply[akka.http.scaladsl.model.StatusCodes.Success](akka.http.scaladsl.model.StatusCodes.NoContent)(marshalling.this.Marshaller.fromStatusCode)) })))))
92 46779 3109 - 3119 Select org.make.api.technical.auth.MakeAuthentication.makeOAuth2 DefaultMigrationApiComponent.this.makeOAuth2
93 34526 3163 - 3176 Select scalaoauth2.provider.AuthInfo.user userAuth.user
93 48668 3146 - 5097 Apply scala.Function1.apply server.this.Directive.addByNameNullaryApply(DefaultMigrationApiComponent.this.requireAdminRole(userAuth.user)).apply(server.this.Directive.addDirectiveApply[(Boolean,)](DefaultMigrationApi.this.parameter(ParameterDirectives.this.ParamSpec.forNR[Boolean](DefaultMigrationApi.this._string2NR("dry").as[Boolean])(unmarshalling.this.Unmarshaller.booleanFromStringUnmarshaller)))(util.this.ApplyConverter.hac1[Boolean]).apply(((dry: Boolean) => { val batchSize: Int = 1000; val startTime: Long = java.lang.System.currentTimeMillis(); val eventDate: java.time.ZonedDateTime = org.make.core.DateHelper.now(); StreamUtils.asyncPageToPageSource[org.make.core.user.User](((offset: Int) => DefaultMigrationApiComponent.this.userService.adminFindUsers(org.make.core.technical.Pagination.Offset.apply(offset), scala.Some.apply[org.make.core.technical.Pagination.End](org.make.core.technical.Pagination.End.apply(offset.+(batchSize))), scala.None, scala.None, scala.None, scala.None, scala.None, scala.None, scala.None, scala.None)))(scala.concurrent.ExecutionContext.Implicits.global).map[Seq[(org.make.core.user.UserId, Option[String])]](((users: Seq[org.make.core.user.User]) => users.map[(org.make.core.user.UserId, Option[String])](((user: org.make.core.user.User) => scala.Predef.ArrowAssoc[org.make.core.user.UserId](user.userId).->[Option[String]](user.profile.flatMap[String](((x$2: org.make.core.profile.Profile) => x$2.avatarUrl))))))).mapConcat[(org.make.core.user.UserId, Option[String])](((x: Seq[(org.make.core.user.UserId, Option[String])]) => scala.Predef.identity[Seq[(org.make.core.user.UserId, Option[String])]](x))).collect[(org.make.core.user.UserId, String)](({ @SerialVersionUID(value = 0) final <synthetic> class $anonfun extends scala.runtime.AbstractPartialFunction[(org.make.core.user.UserId, Option[String]),(org.make.core.user.UserId, String)] with java.io.Serializable { def <init>(): <$anon: ((org.make.core.user.UserId, Option[String])) => (org.make.core.user.UserId, String)> = { $anonfun.super.<init>(); () }; final override def applyOrElse[A1 <: (org.make.core.user.UserId, Option[String]), B1 >: (org.make.core.user.UserId, String)](x1: A1, default: A1 => B1): B1 = ((x1.asInstanceOf[(org.make.core.user.UserId, Option[String])]: (org.make.core.user.UserId, Option[String])): (org.make.core.user.UserId, Option[String]) @unchecked) match { case (_1: org.make.core.user.UserId, _2: Option[String]): (org.make.core.user.UserId, Option[String])((id @ _), (value: String): Some[String]((avatarUrl @ _))) => scala.Predef.ArrowAssoc[org.make.core.user.UserId](id).->[String](avatarUrl) case (defaultCase$ @ _) => default.apply(x1) }; final def isDefinedAt(x1: (org.make.core.user.UserId, Option[String])): Boolean = ((x1.asInstanceOf[(org.make.core.user.UserId, Option[String])]: (org.make.core.user.UserId, Option[String])): (org.make.core.user.UserId, Option[String]) @unchecked) match { case (_1: org.make.core.user.UserId, _2: Option[String]): (org.make.core.user.UserId, Option[String])((id @ _), (value: String): Some[String]((avatarUrl @ _))) => true case (defaultCase$ @ _) => false } }; new $anonfun() }: PartialFunction[(org.make.core.user.UserId, Option[String]),(org.make.core.user.UserId, String)])).mapAsync[Int](5)(((x0$1: (org.make.core.user.UserId, String)) => x0$1 match { case (_1: org.make.core.user.UserId, _2: String): (org.make.core.user.UserId, String)((id @ _), (avatarUrl @ _)) => if (dry) scala.concurrent.Future.successful[Int](1) else DefaultMigrationApiComponent.this.userService.changeAvatarForUser(id, avatarUrl, org.make.core.RequestContext.empty, eventDate).map[Int](((x$3: Unit) => 1))(scala.concurrent.ExecutionContext.Implicits.global) })).runFold[Int](0)(((x$4: Int, x$5: Int) => x$4.+(x$5)))(stream.this.Materializer.matFromSystem(DefaultMigrationApiComponent.this.actorSystem)).onComplete[Unit](((x0$2: scala.util.Try[Int]) => x0$2 match { case (value: Int): scala.util.Success[Int]((count @ _)) => { val time: Long = java.lang.System.currentTimeMillis().-(startTime); DefaultMigrationApiComponent.this.logger.info(("".+(count).+(" users have had their avatars updated in ").+(time).+(" ms"): String)) } case (exception: Throwable): scala.util.Failure[Int]((exception @ _)) => DefaultMigrationApiComponent.this.logger.error("Error while updating avatars path:", exception) }))(scala.concurrent.ExecutionContext.Implicits.global); DefaultMigrationApi.this.complete(marshalling.this.ToResponseMarshallable.apply[akka.http.scaladsl.model.StatusCodes.Success](akka.http.scaladsl.model.StatusCodes.NoContent)(marshalling.this.Marshaller.fromStatusCode)) })))
93 47829 3146 - 3177 Apply org.make.api.technical.MakeAuthenticationDirectives.requireAdminRole DefaultMigrationApiComponent.this.requireAdminRole(userAuth.user)
94 49446 3212 - 3212 Select akka.http.scaladsl.unmarshalling.PredefinedFromStringUnmarshallers.booleanFromStringUnmarshaller unmarshalling.this.Unmarshaller.booleanFromStringUnmarshaller
94 31146 3194 - 5083 Apply scala.Function1.apply server.this.Directive.addDirectiveApply[(Boolean,)](DefaultMigrationApi.this.parameter(ParameterDirectives.this.ParamSpec.forNR[Boolean](DefaultMigrationApi.this._string2NR("dry").as[Boolean])(unmarshalling.this.Unmarshaller.booleanFromStringUnmarshaller)))(util.this.ApplyConverter.hac1[Boolean]).apply(((dry: Boolean) => { val batchSize: Int = 1000; val startTime: Long = java.lang.System.currentTimeMillis(); val eventDate: java.time.ZonedDateTime = org.make.core.DateHelper.now(); StreamUtils.asyncPageToPageSource[org.make.core.user.User](((offset: Int) => DefaultMigrationApiComponent.this.userService.adminFindUsers(org.make.core.technical.Pagination.Offset.apply(offset), scala.Some.apply[org.make.core.technical.Pagination.End](org.make.core.technical.Pagination.End.apply(offset.+(batchSize))), scala.None, scala.None, scala.None, scala.None, scala.None, scala.None, scala.None, scala.None)))(scala.concurrent.ExecutionContext.Implicits.global).map[Seq[(org.make.core.user.UserId, Option[String])]](((users: Seq[org.make.core.user.User]) => users.map[(org.make.core.user.UserId, Option[String])](((user: org.make.core.user.User) => scala.Predef.ArrowAssoc[org.make.core.user.UserId](user.userId).->[Option[String]](user.profile.flatMap[String](((x$2: org.make.core.profile.Profile) => x$2.avatarUrl))))))).mapConcat[(org.make.core.user.UserId, Option[String])](((x: Seq[(org.make.core.user.UserId, Option[String])]) => scala.Predef.identity[Seq[(org.make.core.user.UserId, Option[String])]](x))).collect[(org.make.core.user.UserId, String)](({ @SerialVersionUID(value = 0) final <synthetic> class $anonfun extends scala.runtime.AbstractPartialFunction[(org.make.core.user.UserId, Option[String]),(org.make.core.user.UserId, String)] with java.io.Serializable { def <init>(): <$anon: ((org.make.core.user.UserId, Option[String])) => (org.make.core.user.UserId, String)> = { $anonfun.super.<init>(); () }; final override def applyOrElse[A1 <: (org.make.core.user.UserId, Option[String]), B1 >: (org.make.core.user.UserId, String)](x1: A1, default: A1 => B1): B1 = ((x1.asInstanceOf[(org.make.core.user.UserId, Option[String])]: (org.make.core.user.UserId, Option[String])): (org.make.core.user.UserId, Option[String]) @unchecked) match { case (_1: org.make.core.user.UserId, _2: Option[String]): (org.make.core.user.UserId, Option[String])((id @ _), (value: String): Some[String]((avatarUrl @ _))) => scala.Predef.ArrowAssoc[org.make.core.user.UserId](id).->[String](avatarUrl) case (defaultCase$ @ _) => default.apply(x1) }; final def isDefinedAt(x1: (org.make.core.user.UserId, Option[String])): Boolean = ((x1.asInstanceOf[(org.make.core.user.UserId, Option[String])]: (org.make.core.user.UserId, Option[String])): (org.make.core.user.UserId, Option[String]) @unchecked) match { case (_1: org.make.core.user.UserId, _2: Option[String]): (org.make.core.user.UserId, Option[String])((id @ _), (value: String): Some[String]((avatarUrl @ _))) => true case (defaultCase$ @ _) => false } }; new $anonfun() }: PartialFunction[(org.make.core.user.UserId, Option[String]),(org.make.core.user.UserId, String)])).mapAsync[Int](5)(((x0$1: (org.make.core.user.UserId, String)) => x0$1 match { case (_1: org.make.core.user.UserId, _2: String): (org.make.core.user.UserId, String)((id @ _), (avatarUrl @ _)) => if (dry) scala.concurrent.Future.successful[Int](1) else DefaultMigrationApiComponent.this.userService.changeAvatarForUser(id, avatarUrl, org.make.core.RequestContext.empty, eventDate).map[Int](((x$3: Unit) => 1))(scala.concurrent.ExecutionContext.Implicits.global) })).runFold[Int](0)(((x$4: Int, x$5: Int) => x$4.+(x$5)))(stream.this.Materializer.matFromSystem(DefaultMigrationApiComponent.this.actorSystem)).onComplete[Unit](((x0$2: scala.util.Try[Int]) => x0$2 match { case (value: Int): scala.util.Success[Int]((count @ _)) => { val time: Long = java.lang.System.currentTimeMillis().-(startTime); DefaultMigrationApiComponent.this.logger.info(("".+(count).+(" users have had their avatars updated in ").+(time).+(" ms"): String)) } case (exception: Throwable): scala.util.Failure[Int]((exception @ _)) => DefaultMigrationApiComponent.this.logger.error("Error while updating avatars path:", exception) }))(scala.concurrent.ExecutionContext.Implicits.global); DefaultMigrationApi.this.complete(marshalling.this.ToResponseMarshallable.apply[akka.http.scaladsl.model.StatusCodes.Success](akka.http.scaladsl.model.StatusCodes.NoContent)(marshalling.this.Marshaller.fromStatusCode)) }))
94 41338 3204 - 3221 ApplyToImplicitArgs akka.http.scaladsl.server.directives.ParameterDirectives.ParamSpec.forNR ParameterDirectives.this.ParamSpec.forNR[Boolean](DefaultMigrationApi.this._string2NR("dry").as[Boolean])(unmarshalling.this.Unmarshaller.booleanFromStringUnmarshaller)
94 33463 3194 - 3222 Apply akka.http.scaladsl.server.directives.ParameterDirectivesInstances.parameter DefaultMigrationApi.this.parameter(ParameterDirectives.this.ParamSpec.forNR[Boolean](DefaultMigrationApi.this._string2NR("dry").as[Boolean])(unmarshalling.this.Unmarshaller.booleanFromStringUnmarshaller))
94 32422 3204 - 3221 TypeApply akka.http.scaladsl.common.NameReceptacle.as DefaultMigrationApi.this._string2NR("dry").as[Boolean]
94 46223 3203 - 3203 TypeApply akka.http.scaladsl.server.util.ApplyConverterInstances.hac1 util.this.ApplyConverter.hac1[Boolean]
94 40233 3204 - 3209 Literal <nosymbol> "dry"
95 38973 3269 - 3273 Literal <nosymbol> 1000
96 34564 3306 - 3332 Apply java.lang.System.currentTimeMillis java.lang.System.currentTimeMillis()
97 47870 3365 - 3381 Apply org.make.core.DefaultDateHelper.now org.make.core.DateHelper.now()
99 34039 3450 - 3450 Select scala.concurrent.ExecutionContext.Implicits.global scala.concurrent.ExecutionContext.Implicits.global
101 41138 3504 - 3911 Apply org.make.api.user.UserService.adminFindUsers DefaultMigrationApiComponent.this.userService.adminFindUsers(org.make.core.technical.Pagination.Offset.apply(offset), scala.Some.apply[org.make.core.technical.Pagination.End](org.make.core.technical.Pagination.End.apply(offset.+(batchSize))), scala.None, scala.None, scala.None, scala.None, scala.None, scala.None, scala.None, scala.None)
102 40766 3556 - 3581 Apply org.make.core.technical.Pagination.Offset.apply org.make.core.technical.Pagination.Offset.apply(offset)
103 41099 3607 - 3647 Apply scala.Some.apply scala.Some.apply[org.make.core.technical.Pagination.End](org.make.core.technical.Pagination.End.apply(offset.+(batchSize)))
103 31855 3627 - 3645 Apply scala.Int.+ offset.+(batchSize)
103 49978 3612 - 3646 Apply org.make.core.technical.Pagination.End.apply org.make.core.technical.Pagination.End.apply(offset.+(batchSize))
104 33503 3673 - 3677 Select scala.None scala.None
105 47280 3703 - 3707 Select scala.None scala.None
106 38399 3733 - 3737 Select scala.None scala.None
107 34599 3763 - 3767 Select scala.None scala.None
108 47618 3793 - 3797 Select scala.None scala.None
109 40805 3823 - 3827 Select scala.None scala.None
110 32922 3853 - 3857 Select scala.None scala.None
111 49400 3883 - 3887 Select scala.None scala.None
115 40560 3986 - 4053 Apply scala.collection.IterableOps.map users.map[(org.make.core.user.UserId, Option[String])](((user: org.make.core.user.User) => scala.Predef.ArrowAssoc[org.make.core.user.UserId](user.userId).->[Option[String]](user.profile.flatMap[String](((x$2: org.make.core.profile.Profile) => x$2.avatarUrl)))))
115 35048 4019 - 4052 Apply scala.Option.flatMap user.profile.flatMap[String](((x$2: org.make.core.profile.Profile) => x$2.avatarUrl))
115 47321 4004 - 4015 Select org.make.core.user.User.userId user.userId
115 38926 4040 - 4051 Select org.make.core.profile.Profile.avatarUrl x$2.avatarUrl
115 47656 4004 - 4052 Apply scala.Predef.ArrowAssoc.-> scala.Predef.ArrowAssoc[org.make.core.user.UserId](user.userId).->[Option[String]](user.profile.flatMap[String](((x$2: org.make.core.profile.Profile) => x$2.avatarUrl)))
117 32961 4103 - 4111 Apply scala.Predef.identity scala.Predef.identity[Seq[(org.make.core.user.UserId, Option[String])]](x)
118 45734 4172 - 4187 Apply scala.Predef.ArrowAssoc.-> scala.Predef.ArrowAssoc[org.make.core.user.UserId](id).->[String](avatarUrl)
118 41586 4140 - 4140 Apply org.make.api.technical.DefaultMigrationApiComponent.DefaultMigrationApi.$anonfun.<init> new $anonfun()
119 34075 4218 - 4219 Literal <nosymbol> 5
122 47069 4324 - 4344 Apply scala.concurrent.Future.successful scala.concurrent.Future.successful[Int](1)
122 38961 4324 - 4344 Block scala.concurrent.Future.successful scala.concurrent.Future.successful[Int](1)
125 35090 4474 - 4494 Select org.make.core.RequestContext.empty org.make.core.RequestContext.empty
126 45490 4400 - 4545 Block scala.concurrent.Future.map DefaultMigrationApiComponent.this.userService.changeAvatarForUser(id, avatarUrl, org.make.core.RequestContext.empty, eventDate).map[Int](((x$3: Unit) => 1))(scala.concurrent.ExecutionContext.Implicits.global)
126 32995 4400 - 4545 ApplyToImplicitArgs scala.concurrent.Future.map DefaultMigrationApiComponent.this.userService.changeAvatarForUser(id, avatarUrl, org.make.core.RequestContext.empty, eventDate).map[Int](((x$3: Unit) => 1))(scala.concurrent.ExecutionContext.Implicits.global)
126 40592 4537 - 4537 Select scala.concurrent.ExecutionContext.Implicits.global scala.concurrent.ExecutionContext.Implicits.global
126 47572 4543 - 4544 Literal <nosymbol> 1
129 47104 4619 - 4619 Select org.make.api.technical.ActorSystemComponent.actorSystem DefaultMigrationApiComponent.this.actorSystem
129 41625 4617 - 4618 Literal <nosymbol> 0
129 33205 4620 - 4625 Apply scala.Int.+ x$4.+(x$5)
129 39001 4619 - 4619 ApplyToImplicitArgs akka.stream.Materializer.matFromSystem stream.this.Materializer.matFromSystem(DefaultMigrationApiComponent.this.actorSystem)
130 45528 3398 - 5018 ApplyToImplicitArgs scala.concurrent.Future.onComplete StreamUtils.asyncPageToPageSource[org.make.core.user.User](((offset: Int) => DefaultMigrationApiComponent.this.userService.adminFindUsers(org.make.core.technical.Pagination.Offset.apply(offset), scala.Some.apply[org.make.core.technical.Pagination.End](org.make.core.technical.Pagination.End.apply(offset.+(batchSize))), scala.None, scala.None, scala.None, scala.None, scala.None, scala.None, scala.None, scala.None)))(scala.concurrent.ExecutionContext.Implicits.global).map[Seq[(org.make.core.user.UserId, Option[String])]](((users: Seq[org.make.core.user.User]) => users.map[(org.make.core.user.UserId, Option[String])](((user: org.make.core.user.User) => scala.Predef.ArrowAssoc[org.make.core.user.UserId](user.userId).->[Option[String]](user.profile.flatMap[String](((x$2: org.make.core.profile.Profile) => x$2.avatarUrl))))))).mapConcat[(org.make.core.user.UserId, Option[String])](((x: Seq[(org.make.core.user.UserId, Option[String])]) => scala.Predef.identity[Seq[(org.make.core.user.UserId, Option[String])]](x))).collect[(org.make.core.user.UserId, String)](({ @SerialVersionUID(value = 0) final <synthetic> class $anonfun extends scala.runtime.AbstractPartialFunction[(org.make.core.user.UserId, Option[String]),(org.make.core.user.UserId, String)] with java.io.Serializable { def <init>(): <$anon: ((org.make.core.user.UserId, Option[String])) => (org.make.core.user.UserId, String)> = { $anonfun.super.<init>(); () }; final override def applyOrElse[A1 <: (org.make.core.user.UserId, Option[String]), B1 >: (org.make.core.user.UserId, String)](x1: A1, default: A1 => B1): B1 = ((x1.asInstanceOf[(org.make.core.user.UserId, Option[String])]: (org.make.core.user.UserId, Option[String])): (org.make.core.user.UserId, Option[String]) @unchecked) match { case (_1: org.make.core.user.UserId, _2: Option[String]): (org.make.core.user.UserId, Option[String])((id @ _), (value: String): Some[String]((avatarUrl @ _))) => scala.Predef.ArrowAssoc[org.make.core.user.UserId](id).->[String](avatarUrl) case (defaultCase$ @ _) => default.apply(x1) }; final def isDefinedAt(x1: (org.make.core.user.UserId, Option[String])): Boolean = ((x1.asInstanceOf[(org.make.core.user.UserId, Option[String])]: (org.make.core.user.UserId, Option[String])): (org.make.core.user.UserId, Option[String]) @unchecked) match { case (_1: org.make.core.user.UserId, _2: Option[String]): (org.make.core.user.UserId, Option[String])((id @ _), (value: String): Some[String]((avatarUrl @ _))) => true case (defaultCase$ @ _) => false } }; new $anonfun() }: PartialFunction[(org.make.core.user.UserId, Option[String]),(org.make.core.user.UserId, String)])).mapAsync[Int](5)(((x0$1: (org.make.core.user.UserId, String)) => x0$1 match { case (_1: org.make.core.user.UserId, _2: String): (org.make.core.user.UserId, String)((id @ _), (avatarUrl @ _)) => if (dry) scala.concurrent.Future.successful[Int](1) else DefaultMigrationApiComponent.this.userService.changeAvatarForUser(id, avatarUrl, org.make.core.RequestContext.empty, eventDate).map[Int](((x$3: Unit) => 1))(scala.concurrent.ExecutionContext.Implicits.global) })).runFold[Int](0)(((x$4: Int, x$5: Int) => x$4.+(x$5)))(stream.this.Materializer.matFromSystem(DefaultMigrationApiComponent.this.actorSystem)).onComplete[Unit](((x0$2: scala.util.Try[Int]) => x0$2 match { case (value: Int): scala.util.Success[Int]((count @ _)) => { val time: Long = java.lang.System.currentTimeMillis().-(startTime); DefaultMigrationApiComponent.this.logger.info(("".+(count).+(" users have had their avatars updated in ").+(time).+(" ms"): String)) } case (exception: Throwable): scala.util.Failure[Int]((exception @ _)) => DefaultMigrationApiComponent.this.logger.error("Error while updating avatars path:", exception) }))(scala.concurrent.ExecutionContext.Implicits.global)
130 32209 4657 - 4657 Select scala.concurrent.ExecutionContext.Implicits.global scala.concurrent.ExecutionContext.Implicits.global
132 31111 4735 - 4773 Apply scala.Long.- java.lang.System.currentTimeMillis().-(startTime)
133 47610 4796 - 4867 Apply grizzled.slf4j.Logger.info DefaultMigrationApiComponent.this.logger.info(("".+(count).+(" users have had their avatars updated in ").+(time).+(" ms"): String))
135 39746 4937 - 4998 Apply grizzled.slf4j.Logger.error DefaultMigrationApiComponent.this.logger.error("Error while updating avatars path:", exception)
138 46548 5045 - 5066 ApplyToImplicitArgs akka.http.scaladsl.marshalling.ToResponseMarshallable.apply marshalling.this.ToResponseMarshallable.apply[akka.http.scaladsl.model.StatusCodes.Success](akka.http.scaladsl.model.StatusCodes.NoContent)(marshalling.this.Marshaller.fromStatusCode)
138 38757 5036 - 5067 Apply akka.http.scaladsl.server.directives.RouteDirectives.complete DefaultMigrationApi.this.complete(marshalling.this.ToResponseMarshallable.apply[akka.http.scaladsl.model.StatusCodes.Success](akka.http.scaladsl.model.StatusCodes.NoContent)(marshalling.this.Marshaller.fromStatusCode))
138 42142 5045 - 5066 Select akka.http.scaladsl.model.StatusCodes.NoContent akka.http.scaladsl.model.StatusCodes.NoContent
138 33247 5057 - 5057 Select akka.http.scaladsl.marshalling.PredefinedToResponseMarshallers.fromStatusCode marshalling.this.Marshaller.fromStatusCode